getscrap
PROMPT
The getscrap 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, or they may press the Stop button. If they press Ok, whatever they typed will be placed on the clipboard, where it can be retrieved with the clipboard() function. If they press the Stop button the procedure will stop and the clipboard won’t be updated.
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. If the user presses Stop, the AreaCode field will not be modified.
getscrap "Area code:"
AreaCode=clipboard()
The problem with the getscrap 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 getscrap statement – use the gettext statement instead. Here is a version of this code that has been rewritten so that it doesn’t clobber the clipboard.
gettext "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
- activegrid -- manages the operation of a grid that controls a series of options.
- alert -- displays a modal alert window with a message and one or more buttons.
- alertcanceldelete -- displays a modal alert window with a message and two buttons: *Cancel* and *Delete*.
- alertcancelok -- displays a modal alert window with a message and two buttons: *Cancel* and *Ok*.
- alertdeletecancel -- displays a modal alert window with a message and two buttons: *Delete* and *Cancel*.
- alertmodal -- displays a modal alert sheet (not attached to any window) with a message and one or more buttons.
- alertnoyes -- displays a modal alert window with a message and two buttons: *No* and *Yes*.
- alertok -- displays a modal alert window with a message and one button: *Ok*
- alertokcancel -- displays a modal alert window with a message and two buttons: *Ok* and *Cancel*.
- alertoksmall -- displays a modal alert window with a message and one button: *Ok*
- alertrevertcancel -- displays a modal alert window with a message and two buttons: *Revert* and *Cancel*.
- alertsavecancel -- displays a modal alert window with a message and two buttons: *Save* and *Cancel*.
- alertsheet -- displays an alert sheet (attached to the current window) with a message and one or more buttons. Note: with the introduction of OS 11, Big Sur, sheets no longer appear to slide down from the title bar, but open a dialog centered on the active window.
- alertyesno -- displays a modal alert window with a message and two buttons: *Yes* and *No*.
- alertyesnocancel -- displays a modal alert window with a message and three buttons: *Yes*, *No* and *Cancel*.
- analyzedialog -- opens the standard Analyze dialog.
- bigmessage -- displays a message alert.
- cancelok -- displays a modal alert window with a message and two buttons: *Cancel* and *Ok*.
- choosefiledialog -- displays a modal dialog allowing selection of files or folders.
- choosefolderdialog -- pauses and displays the standard “choose folder” dialog.
- closeallasyncprogresswindows -- closes any asynchronous progress windows.
- columnstatsdialog -- opens the standard Column Stats dialog.
- customdialog -- customizes the appearance of the gettext and getscrap dialogs.
- databaseoptionsdialog -- opens the standard Database Options dialog.
- editfavoritesdialog -- handles the Favorites button in a dialog.
- favoritedatabasedialog -- opens the standard Favorite Databases dialog.
- favoritesbutton -- handles the *Favorites* button in a dialog.
- getscrapok -- will display a dialog with a text entry area. The entered text is placed in the clipboard.
- gettextdialog -- displays a configurable modal dialog that asks the user to enter an item of text.
- gettextokcancel -- displays a modal dialog that asks the user to enter an item of text.
- giantmessage -- displays a message alert.
- importdatabasedialog -- opens the standard Import Database dialog.
- info("modaldialogopen") -- returns true if a modal dialog window is currently open.
- joindialog -- opens the standard Join Database dialog.
- message -- displays a modal alert window with a message.
- morphalldialog -- opens the standard MorphAll dialog.
- morphdialog -- opens the standard Morph dialog.
- noyes -- displays a modal alert window with a message and two buttons: *No* and *Yes*.
- okcancel -- displays a modal alert window with a message and two buttons: *Ok* and *Cancel*.
- openasyncprogresswindow -- opens a floating progress window for asynchronous operations (urltask(, timers).
- openfiledialog -- pauses and displays the standard “open file” dialog.
- popupsharingmenu -- pops up a menu for the toolbar sharing icon.
- progressalert -- displays a progress alert if an operation is going to take a long time.
- rudemessage -- displays a message alert.
- rundialog -- uses a form as a template to display a modal dialog window. The statement supervises the operation of the dialog until it is closed.
- rundialogmenus -- enables custom menus in a modal dialog.
- savedialog -- displays a modal dialog that allows a user to specify the name and location of a new file.
- savefiledialog -- pauses a procedure and displays the standard “save file” dialog.
- selectduplicatesdialog -- opens the standard Select Duplicates dialog.
- showhidefieldsdialog -- opens the standard Show/Hide Fields dialog (in the Fields menu).
- sortdialog -- opens the standard *Sort* dialog.
- statusmessage -- displays a message in the status bar at the bottom of the procedure window.
- stopalert -- displays a modal alert window with a warning icon, a message and one or more buttons.
- supergetpassword -- will display a dialog with a text entry area for a password.
- supergettext -- will display a dialog with a text entry area.
- tallmessage -- displays a message alert.
- yesno -- displays a modal alert window with a message and two buttons: *Yes* and *No*.
History
10.0 | No Change | Carried over from Panorama 6.0. |