getscrapok
PROMPT

The getscrapok statement will display a dialog with a text entry area. The entered text is placed in the clipboard.


Parameters

This statement has one parameter:

prompt – is a message that will be displayed in the dialog, just above the text. This message should explain what the user needs to enter.


Description

This statement will display a dialog with a text entry area. The user may enter something and press Ok. Whatever they typed will be placed on the clipboard, where it can be retrieved with the clipboard() function. There is no way to cancel this dialog!

The dialog is usually just large enough to enter one line containing about 25 characters of text. To make this dialog larger use the customdialog statement. Or for full customization, use the newer gettextdialog statement instead of this statement.

This example asks the user to enter an area code, then enters that code into the AreaCode field when the user presses Ok (there is no Stop or Cancel button).

getscrapok "Area code:"
AreaCode=clipboard()

The problem with the getscrapok statement is that it clobbers the clipboard, which you may be using for something else. So if you are writing new code, don’t use the getscrapok statement – use the gettextokcancel statement instead. Here is a version of this code that has been rewritten so that it doesn’t clobber the clipboard.

gettextokcancel "Area code:",AreaCode

Historical Note: The word “scrap” is the original name for the Macintosh clipboard from the 1980’s, so the name of this statement came from “get scrap”, i.e. get a value into the scrap, i.e. clipboard. Over the years the word “scrap” has gone out of favor and this feature is now usually called the clipboard, but the original term lives on in the name of this statement.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.