Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Commands

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

import paint

import paint from file fileName

The import paint command loads a Paint image to the current card from a file. Import paint only works when one of the Paint tools is chosen.

This command has the same effect as the Import Paint menu item that appears in the File menu (when a Paint tool is chosen), except that it avoids the dialog box that prompts the user for a file name.

If import paint succeeds, HyperCard sets the function the result to empty; if the command fails (if, for example, you use import paint when the Browse tool is chosen), HyperCard sets the result to "Couldn't import paint."


Examples

import paint from file "Sue’s Screen Dump"

answer file "Import paint from what file:" of type paint
if it is not empty then import paint from file it

Placeholders

fileName
An expression that evaluates to a text string that is also a valid Macintosh filename.

For example:

"my stack"
"HD20:Wally's Stacks:my stack"
"my file alias"


Related Topics

« hide | HyperTalk Reference | keyDown »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Commands

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

import paint

import paint from file fileName

The import paint command loads a Paint image to the current card from a file. Import paint only works when one of the Paint tools is chosen.

This command has the same effect as the Import Paint menu item that appears in the File menu (when a Paint tool is chosen), except that it avoids the dialog box that prompts the user for a file name.

If import paint succeeds, HyperCard sets the function the result to empty; if the command fails (if, for example, you use import paint when the Browse tool is chosen), HyperCard sets the result to "Couldn't import paint."


Examples

import paint from file "Sue’s Screen Dump"

answer file "Import paint from what file:" of type paint
if it is not empty then import paint from file it

Placeholders

fileName
An expression that evaluates to a text string that is also a valid Macintosh filename.

For example:

"my stack"
"HD20:Wally's Stacks:my stack"
"my file alias"


Related Topics

« hide | HyperTalk Reference | keyDown »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View