This document describes new and improved features in PerfectScript since Corel WordPerfect Suite 8. This version of this document also includes the undocumented features and commands.
Document Change Log
6-23-98 JDan 1.11 - Describe changes to DDEPoke and DDERequest for rev c or d.
4-13-98 JDan 1.10 - Update return value types for some commands.
11-17-97 SteveCa 1.9 - Renamed document to WordPerfect Suite 8 Professional.
11-3-97 JDan 1.8 - Added clarification on use of Units parameter for RegionGetPosition and RegionMoveWindow.
9-8-97 JDan 1.7 - Minor changes.
9-4-97 JDan 1.6 - Correct minor typo. Describe PerfectScript version number change.
8-4-97 JDan 1.5 - Describe changes to MacroInfo, FileFind, and FileNameDialog.
7-30-97 JDan 1.4 - Describe new Platform Id. Add information about various undocumented commands and options.
7-21-97 JDan 1.3 - Describe the MacroCompile, MacroPlay and MacroIsCompiled commands.
7-3-97 JDan 1.2 - Describe OLE automation inline parameter type mapping functions (Byte, Boolean, etc...).
5-13-97 JDan 1.1 - Initial creation.
Quick Overview of WordPerfect Suite 8 Macro Compatibility
This section provides a quick overview of things that may need to be done to WordPerfect Suite 8 macros to make them work in PerfectScript for Professional Office 8. The sections Obsolete Commands and Language Features and Modified and Improved Commands and Language Features provide more extensive details. As new commands and capabilities are added, new reserved words have also been added. A description of these new reserved words is in the section New Commands and Language features.
PerfectScript (the program--PS80.EXE)
PerfectScript Interface Changes
The status bar of the PerfectScript application now displays the count of macros in the list or macros playing, compiling and recording. This is the total count and is not divided into separate counts of playing, compiling, etc...
A context menu (right mouse click menu) is now available for macros as they record, where the macro may be paused and stopped.
A context menu is now available for the compiling and playing macro icons that display in the system tray. This context menu matches the context menu for the same macro if selected from the PerfectScript interface. Double clicking on the compiling or playing macro icon in the system tray, will bring up the PerfectScript user interface.
Advanced / Hidden Features, Settings and Keystrokes in PerfectScript
The PerfectScript Macro system has a number of hidden features and settings that are not documented, and not supported. These are used primarily for internal debugging and testing, and may contain bugs. Direct access to these features and settings from the user interface of the MacroFacility (PS80) is controlled by a specific registry setting. This registry setting is (note the leading space in the name of the value):
HKEY_CURRENT_USER\Software\Corel\PerfectScript\8\Settings\" Show Hidden Settings" = 1 (DWORD value)
If this setting does not exist, or has a value of 0, then direct access is not available. When this setting does exist, with a value of 1, then additional menu items are available in the MacroFacility, and additional settings are available in the "Settings" dialog. As a reminder that these are hidden features and settings, the text of these menu items is enclosed in "[ ]" symbols, and the text of the settings in the "Settings" dialog are show in italics.
This same registry setting may be toggled on/off through a command accelerator key sequence of "Control Shift Alt ENTER" in the MacroFacility.
Hidden keystrokes Macro Facility (PS80)
Control Shift Alt Object Action
Control Alt F10 key Compile
Shift Alt Insert key Registered Apps
Control Shift Insert key Command Inserter 1
Control Shift Alt Insert key Command Inserter 2
Control Alt Insert key Command Inserter 3
Control Shift Alt Enter key Toggle Hidden Settings
Shift Alt Enter key Macro Info
Control Shift Alt Recent file menu item Compile
Control Shift Recent file menu item Edit
Control Alt Recent file menu item Macro Info
Control Recent file menu item Record
Shift Alt Recent file menu item Debug Compile
Shift Recent file menu item Compile
Alt Recent file menu item Debug Play
Recent file menu item Play
Del Recent file menu item Remove from recent file list
Home Recent file menu item Move to top of recent file list
Hidden keystrokes in the Command Inserter
Control Shift Alt Object Action
Control Shift Insert button Dump Command List (also button in advanced)
Control Shift Alt Insert button Brief Command Dump (also button in advanced)
Control Select command list item Show Return-value Enumerations (also button in advanced)
Hidden keystrokes in the Macro Interpreter
Control Shift Alt Object Action
Control Shift Alt Cancel button in "Prompt" Invoke Macro Debugger
Control Shift Alt Cancel button in "Get..." Invoke Macro Debugger
Control Shift Alt Any button in "MessageBox" Invoke Macro Debugger
Hidden registry settings
All hidden registry settings (except those stated below) can be accessed in the "Settings" dialog of the MacroFacility. These settings are located in HKEY_CURRENT_USER\Software\Corel\PerfectScript\8\Settings\...
"Prefered Interface Language" = (string) "US" (default="US")
"Time Out Tkn App Launch" = (DWORD) (default = 300)
"Prompt on Tkn App Launch" = (DWORD) 1 or 0 (default=0)
"Show Tray Icons" = (DWORD) 1 or 0 (default=1)
"Run Unattended" = (DWORD) 1 or 0 (default=0)
"Compiler\Generate Scrubber File" = (DWORD) 1 or 0 (default=0) [not used]
"Compiler\Allow Unknown OLE Objects" = (DWORD) 1 or 0 (default=0)
"Interpreter\Show matherr Messages" = (DWORD) 1 or 0 (default=0) [not used]
"Interpreter\Use New Error Dialog" = (DWORD) 1 or 0 (default=1)
"Interpreter\VersionInfo-Platform" = (string) "" (default "VERSION.DLL")
"Interpreter\VersionInfo-PerfectFit = (string) "" (default "PFIT80.DLL")
"Interpreter\VersionInfo-PerfectScript = (string) "" (default "PS80.EXE")
"Interpreter\VersionInfo-%s" = (string) "" (default "")
"Interpreter\Show Progress During Play" = (DWORD) 1 or 0 (default=0) [not used]
Hidden preference dialog settings
The following preference settings are accessable from the "Settings" dialog of the MacroFacility when the Advanced / Hidden settings are enabled:
General page
Show elapsed time
Display debug messages
Debug page
Show full routine data
Show actual variable data types
Show "Internal Variables" button
Show "Runtime Stack" button
Show "Object Code" button
Show "Load" and "Save" buttons
Display all breakpoints
Debugger startup file
Compile page
Convert commas to semicolons
Ignore trailing semicolons
Ask to overwrite current object
Ask for listing filename
Ask to overwrite listing file
Generate detailed listing
Generate opcode statistics
Display compile warnings
Display compile errors
Display compile fatal errors
Display compile message %d [not used]
Command Browser page
Use theta indexes
Show actual data types
Show all PIDs
Show all parameters
Show all enumerations
Show token ids
Show enumeration values
OLE Automation
Inline parameter functions have been added (similar to DLLCall) that allow the specific data type and format to be specified for parameters in calls to OLE automation methods and properties. See the section New Commands and Language features for details.
Dialog Editor, and Dialog and Region Statements
Command Inserter
If the Control key is held down when clicking on a command in the Commands list box, then if that command returns an enumeration, then the enumeration values are listed in the Enumerations list box. If the command does not return an enumeration, then the command is selected and displayed as usual.
When the Advanced / Hidden settings are enabled in PerfectScript (see above), then a new button appears on the command inserter called "Return Enums". Pressing on this button performs the same function that Control clicking on a command in the Commands list box performs.
Obsolete Commands and Language Features
In a future release of PerfectScript, there are some commands that will or may not be supported. Users are encouraged to replace these commands with their functional equivalents (if any) as soon as possible. For backward macro compatibility, these commands will continue to be supported, but they will no longer be documented in the command browser or in the macro help information. These commands may be eliminated in some future release.
FileFind.Attributes.Archived
GetFileAttributes.Archived!
SetFileAttributes.Attributes.Archived!
FileFind.Attributes.Archived, GetFileAttributes.Archived! and SetFileAttributes.Attributes.Archived!
This enumeration has been renamed to Archive!.
Modified and Improved Commands and Language Features
This section describes changes to existing commands and, where applicable, incompatibilities that may arise with old macros. In this section, "..." indicates places where existing capabilities have not been changed.
...
version number
The version number of the PerfectScript macro system has been changed to 8.1.1, to allow compile time and runtime version specific checks. This affects the IfPlatform, ElseIfPlatform, EndIfPlatform, MacroInfo and VersionInfo commands. This will also cause a macro compiled under this PerfectScript macro system to recompile on an older version macro system.
numeric := <VariableName>array[0; <Index>numeric] - array element count
This is not a command, but this is an access to the [0; Index] element of an array. When an access to an element of an array is made that specifies zero as the index of the first (or only) dimension, the number of elements in the array is returned for the spcified dimension. Note that a zero index for the first dimension is always specified, and a second index may also be specified, which is the dimension number to return index information about. At most two indexes may be specified, regardless of the number of dimensions the array was declared with. This is the same value that is returned from the command Dimensions (VariableName[ ]; Index).
Chain (...)
If the specified macro file is not found, a NotFound condition is asserted.
DDEPoke (...; [TimeOut:numeric or enumeration])
A new TimeOout parameter has been added.
[TimeOut] This specifies the maximum amount of time to wait for the poke operation to complete. This value is expressed in milliseconds (ie. 1000 = 1 second), and must be > 0. Rather than a numeric value, one of the following enumerations may be specified instead. If missing, Standard! is used.
Standard! Use 18000 ms (18 seconds). This is the same value that was used by this command before a TimeOut parameter was added.
NoTimeOut! This command uses the maximum timeout value possible (approximately 24.8 days).
... := DDERequest (...; [TimeOut:numeric or enumeration])
A new TimeOout parameter has been added.
[TimeOut] This specifies the maximum amount of time to wait for the poke operation to complete. This value is expressed in milliseconds (ie. 1000 = 1 second), and must be > 0. Rather than a numeric value, one of the following enumerations may be specified instead. If missing, Standard! is used.
Standard! Use 18000 ms (18 seconds). This is the same value that was used by this command before a TimeOut parameter was added.
NoTimeOut! This command uses the maximum timeout value possible (approximately 24.8 days).
... := DialogAddControl (...; [MacroVar:variable]; ...)
The MacroVar parameter is no longer required.
[MacroVar] The MacroVar parameter is now optional
ElseIfPlatform ([{<PlatformID>enumeration}])
EndIfPlatform ([{<PlatformID>enumeration}])
See IfPlatform below.
... := FileFind (...; [Attributes:enumeration]; ...)
New enumerations have been added to the Attributes parameter. The Archived! enumeration of the Attributes parameter has been renamed to Archive!.
[Attributes] In addition to the desired attributes, this parameter also specifies certain options for the search operation. If none of these options is specified, then MatchAnyAttribute! is used.
SkipDotDirs! When the attributes includes Directory!, then the "." and ".." directories will be skipped and not returned.
SearchSubDirs! Also search sub-directories for files that match the specified attributes.
MatchAnyAttribute! All files that have at least one of the specified attributes are returned. The files may also have other attributes besides those specified.
MinimumAttributes! All files that have at least all of the specified attributes are returned. The files may also have other attributes besides those specified.
ExactAttributes! All files that have exactly the specified attributes are returned. The files may have no other attributes.
Modified! This is a synonym for the Archive! attribute.
Temporary! This attribute is passed to Windows to select files with this attribute. It is unknown whether files may exist with this attribute or not.
Compressed! This attribute is passed to Windows to select files with this attribute. It is unknown whether files may exist with this attribute or not.
OffLine! This attribute is passed to Windows to select files with this attribute. It is unknown whether files may exist with this attribute or not.
... := FileNameDialog ([StyleOptions:enumeration]; ...; [Separator:string])
The StyleOptions parameter is now optional. New enumerations have been added to the StyleOptions parameters. A new Separator parameter has been added. The return value may be a list of files.
return-value The file/directory or files/directories that were selected is/are returned.
[StyleOptions] This parameter specifies the styles or options for the type of dialog to display and what the dialog will allow. If missing, then OpenDialog! | PerfectFitDialog! is used.
DirectoryDialog! The dialog displayed will be a directory selection dialog, rather than a file selection dialog. If FileMustExist! is also specified, then the directory must already exist.
WindowsDialog! The Windows common dialog will be displayed, rather than the PerfectFit custom dialog.
PerfectFitDialog! The PerfectFit custom dialog will be displayed, rather than the Windows common dialog.
MultipleFiles! Allow multiple files or directories to be selected. The return value will be a list of files or directories, separated by the Separator parameter.
[Separator] If multiple files or directories are returned, this string is inserted between each entry that is returned. If missing, then ";" is used.
enumeration := GetFileAttributes (...)
The Archived! enumeration return value been renamed to Archive!. New return enumerations have been added.
return-value The attributes that the file has. The return value could be any combination of the following values.
Modified! This is a synonym for the Archive! attribute.
Temporary! The file has the Temporary attribute. It is unknown whether files may exist with this attribute or not.
Compressed! The file has the Compressed attribute. It is unknown whether files may exist with this attribute or not.
OffLine! The file has the OffLine attribute. It is unknown whether files may exist with this attribute or not.
IfPlatform ([{<PlatformID>enumeration}])
A new enumeration has been added to the PlatformID parameter. This is a compile time only statement, and cannot be used at runtime to determine the platform id or version the the macro is running on. Use the MacroInfo command, or the VersionInfo command to determine platform type and version numbers at runtime.
[{PlatformID}] This parameter specifies a list of ids. If any of the ids in this list matches the id that this version of the macro system recognizes, then the statements in the body of the IfPlatform block will be compiled. Otherwise the body is ignored as if it contained comments. If the id is a numerical or string value, then this value is compared to the version number of the current macro system, and if equal, then the body of statements are compiled. If this parameter is missing, then the statement body is ignored as if no recognized id was specified.
_Version8_0_1! This enumeration is recognized if the macro is compiled using the version 8 Professional PerfectScript macro system.
8.1 Any numeric value is compared against the macro system version number. (don't document this for this version).
"8.1" Any string value is compared against the macro system version number. (don't document this for this version).
_Version_! When this enumeration is used, then a relational comparision expression is expected to follow this. The format is:
_Version_! <operator> <value>string
The accepted <operator>s are:
=, !=, <>, <, <=, >, >=
The <value> is a numeric or string value representing the version number to check for.
The current macro system version number is compared to the provided <value> using the specified <operator>, and if the comparison is True, then the PlatformID is considered to match the current platform id. If the provided <value> contains only a major version number, then only the major version number is compared. If it contains only a major and minor version number, then only the minor and major version numbers are compared. For example, if <Value> is "8", then it will match all versions of 8. If "8.0" is specified, then only version 8.0 (WP8) will match (PO8 was version "8.1.1").
any (..., date, ...) := ... := MacroInfo (InfoItem:enumeration; ...; {[ItemData:enumeration]})
New enumerations for the InfoItem parameter have been added. New enumerations have been added to the ItemData parameter.
InfoItem
TimeWindowsStarted! (Numeric date) This item will return the time that this session of Windows was started.
TimeWindowsElapsed! (Numeric date) This item will return the elapsed time that this session of Windows has been running.
TimeMacroStarted! (Numeric date) This item will return the time that this macro was started.
TimeElapsed! (Numeric date) This item will return the elapsed time that this macro has been playing.
TimeElapsedNet! (Numeric date) This item will return the elapsed time that this macro has spent in the macro system (TimeElapsed! - TimeInProductCalls! - TimeInDLLCalls! - TimeInOLEObjects!).
TimeInProductCallls! (Numeric date) This item will return the elapsed time that this macro has spent in calls to product commands of other Corel applications.
TimeInDLLCalls! (Numeric date) This item will return the elapsed time that this macro has spent in calls to DLL routines.
TimeInOLEObjects! (Numeric date) This item will return the elapsed time that this macro has spent in calls to OLE automation objects.
RunUnattended! (Boolean) This will return whether the macro is playing in the unattended mode that automatically dismisses prompts and dialogs. This mode may be set by the advanced / hidden PerfectScript setting "Run Unattended", and by the NoPrompts! enumeration of the Options parameter of the MacroPlay command. This state may also be turned on / off by this command by specifying On! or Off! for the ItemData parameter of this command.
[ItemData]
ResetTime! or <time value> Can be used with the Time...! InfoItem values to reset the specified internal timers to zero if ResetTime or 0 is specified, or can be a new time value to set the specified internal timer to. (Cannot be used with the TimeWindowsStarted! or TimeWindowsElapsed! enumerations).
On! Can be used with the RunUnattended! InfoItem value to turn on unattended mode.
Off! Can be used with the RunUnattended! InfoItem value to turn off unattended mode.
NoChange! Can be used with the RunUnattended! InfoItem value to just return the current setting. If this parameter is missing, NoChage! is used.
Nest (...)
If the specified macro file is not found, a NotFound condition is asserted.
... := RegionGetPosition (...; Units:enumeration)
A clarification on the use of the Units parameter is in order. The Units parameter allows the use of either dialog units (DialogUnits!) or screen units (ScreenUnits!). DialogUnits! specifies that the position and size values are in dialog units, which are relative to the size of the font being used in the dialog. ScreenUnits specifies that the values are in screen units (pixels). If DialogUnits! is specified as the value of the Units paramater, then the specified region must be a dialog, otherwise an error is asserted, since there is no dialog information for the region to get the font size for. If ScreenUnits! is specified, then the region specified may be a dialog or a non-dialog type of window. A new enumeration has been added to the Units parameter.
[Units] Specify the type of units to return.
Percent! Return the Left and Top position as percentages of the screen width and height. These are not actually the positions of the top left corner, but of the center of the region. If the region is a dialog, then this would be the same value that is used in the Left and Top parameters of the DialogDefine command when Percent! is included in the Style parameter. Also return the Width and Height as percentages of the screen width and height.
... := RegionMoveWindow (...; Units:enumeration)
A clarification on the use of the Units parameter is in order. The Units parameter allows the use of either dialog units (DialogUnits!) or screen units (ScreenUnits!). DialogUnits! specifies that the position and size values are in dialog units, which are relative to the size of the font being used in the dialog. ScreenUnits specifies that the values are in screen units (pixels). If DialogUnits! is specified as the value of the Units paramater, then the specified region must be a dialog, otherwise an error is asserted, since there is no dialog information for the region to get the font size for. If ScreenUnits! is specified, then the region specified may be a dialog or a non-dialog type of window. A new enumeration has been added to the Units parameter.
[Units] Specify the type of units to interpret the Top, Left, Width and Height as.
Percent! The Left and Top position as percentages of the screen width and height. These are not actually the positions of the top left corner, but of the center of the region. If the region is a dialog, then this would be the same value that is used in the Left and Top parameters of the DialogDefine command when Percent! is included in the Style parameter. The Width and Height are also interpreted as percentages of the screen width and height.
... := RoundOff (...; [RoundTo:numeric])
A different value is now returned if the RoundTo parameter is 0. Before, 0.0 was always returned (not very useful).
[RoundTo] If this value is specified as 0, then the value is truncated toward 0.
Run (...)
If the specified macro file is not found, a NotFound condition is asserted.
502763 When a macro specified in a Run or Chain command cannot be found, a NotFound condition is asserted.
... := SetFileAttributes (...; [Attributes:enumeration]; ...)
The Archived! enumeration of the Attributes parameter has been renamed to Archive!. New enumerations have been added to the Attributes parameter.
[Attributes]
Modified! This is a synonym for the Archive! attribute.
Temporary! Set the Temporary attribute. It is unknown whether files may exist with this attribute or not.
Compressed! Set the Compressed attribute. It is unknown whether files may exist with this attribute or not.
OffLine! Set the OffLine attribute. It is unknown whether files may exist with this attribute or not.
New Commands and Language features
This section describes new commands and language features which have been added.
new reserved words
...
new reserved words
New keywords have been added to the macro language. These keywords are reserved words and may not be used as variable or label names in macros. In addition to these new reserved keywords, the name of any new commands are also considered reserved words, since those names also cannot be used as variable or label names. (However, just because a new reserved keyword is on this list, does not imply that there is a new command or feature by that name that can be accessed.) The new reserved keywords that have been added are:
Several new commands have been added, which are now reserved words, but they do not need to be listed separately. See below for the list of new commands.
...
boolean := Bool (<Value>boolean)
boolean := Boolean (<Value>boolean)
unsigned 1 byte numeric := Byte (<Value>numeric)
signed 2 byte numeric := Integer (<Value>numeric)
unsigned 2 byte numeric := Word (<Value>numeric)
signed 4 byte numeric := Long (<Value>numeric)
unsigned 4 byte numeric := DWord (<Value>numeric)
4 byte floating point numeric := Single (<Value>numeric)
8 byte floating point numeric := Double (<Value>numeric)
8 byte floating point numeric := Real (Value>numeric)
ansi string := String (<Value>string)
ansi string := AnsiString (<Value>string)
ansi string := OEMString (<Value>string)
ansi string := WPString (<Value>string)
numeric := Currency (<Value>numeric)
numeric := Date (<Value>numeric)
OLEObject := Object (<Value>OLEObject)
any := Variant (<Value>any)
rawbinary := Structure (<Value>any)
variable := Reference (<VariableName>variable)
variable := Address (<VariableName>variable)
variable := &<VariableName>variable
These inline parameter functions have been added to allow the specific type and format of a parameter to be specified. They may only be used to pass parameters in calls to OLE automation methods or properties, and will generate a compile error if used in any other place (except DLLCall). They operate similar to the inline parameter functions for DLLCall, and several of these functions have the same names.
return-value The return value from these functions is a value of the specified type.
<Value> or <VariableName> This is the value or variable to be converted and passed as a parameter.
boolean := DialogDelete (Dialog:string)
The command will remove a binary dialog definition from the prefix area of the current macro file.
return-value The value True is returned is the dialog is deleted, False otherwise.
Dialog The name of the dialog to be deleted. Dialogs can only be deleted from the prefix area of the current macro file. To delete a dialog from a different macro file, add the DialogDelete command to a routine in that macro file, and call that routine from your macro.
numeric or enumeration := MacroCompile (MacroFileName:filename; [Options:enumeration])
This command will cause the Macro Facility to compile the specified macro file. If the specified macro file cannot be found, then a NotFound condition is asserted. If the macro file couldn't be opened, then an Error condition is asserted. Otherwise this command does not assert a condition, but returns a success indicator.
return-value If the macro compilation is succesful, then the enumeration value of Success! is returned, otherwise the line number and character position within the line of the last syntax error is returned. The line number is stored in the loword of the return value, and the character position is stored in the hiword. These values may be extracted using the following macro code:
x := MacroCompile (file)
vLinenumber := x & 0ffffx
vCharPosition := x >> 16
Success! The macro compilation was successful.
MacroFileName The name of the macro file to compile.
[Options] Options affecting how the macro is compiled. If missing, Wait! is used.
Wait! Wait for the compile to complete. If neither Wait! or DontWait! is specified, then Wait! is used.
DontWait! Don't wait for the compile to finish. If neither Wait! or DontWait! is specified, then Wait! is used.
Debug! Compile the macro for debugging. This is the same as choosing the File/Debug/Compile menu item in the Macro Facility.
NoPrompts! Don't display or wait for any prompts or dialogs from the macro compiler. All compiler prompts and dialogs are automatically dismissed with the default option for that prompt or dialog. For the syntax error dialog, the default action for syntax warnings is to continue the compile. The default action for syntax errors and fatal errors is to cancel the compile.
ShowProgress! Display the compile progress and compilation summary dialogs during the compile. If NoPrompts! is specified, then the summary dialog is automatically dismissed and does not require user dismissal.
GenerateListing! Generate a compiler listing file. If NoPrompts! is specified, then the prompts to specify the listing file name, and to overwrite any existing listing file, are automatically dismissed, causing the listing file to overwrite any file by the same name.
ForceRecompile! If the macro is already compiled, then recompile the macro anyway. If NoPrompts! is specified!, then the prompt to overwrite the up to date macro object is automatically dismissed, causing the macro to be recompiled and to overwrite the macro object if it was already up to date.
ShowIcon! Show an icon in the Windows system tray area while this macro is being compiled. This option only has an effect if the PerfectScript advanced/hidden setting "Show Tray Icons" is turned off, since a tray icon is normally always displayed. If it is turned off, then tray icons are not displayed, and then this option causes the icon to be displayed.
DebugMode! Run the PerfectFit macro compiler to run in internal debug mode. This causes some additional prompts to be displayed when certain conditions are detected.
numeric := MacroIsCompiled (MacroFileName:filename)
This command will see if the specified macro file is compiled. If the specified macro file cannot be found, then a NotFound condition is asserted. If the macro file couldn't be opened, then an Error condition is asserted. Otherwise this command does not assert a condition, but returns the compiled status of the macro file.
return-value If the macro is already compiled and is up to date, True is returned. Otherwise False is returned.
MacroFileName The name of the macro file to see if it is compiled.
numeric or enumeration := MacroPlay (MacroFileName:filename; [Options:enumeration]; [{Parameter:any}])
This command will cause the Macro Facility to play the specified macro file. The macro runs as a completely independant macro in parallel with the current macro. If the specified macro file cannot be found, then a NotFound condition is asserted. If the macro file couldn't be opened, then an Error condition is asserted. Otherwise this command does not assert a condition, but returns a success indicator.
return-value If the macro compilation is succesful, then the enumeration value of Success! is returned, otherwise the line number where the macro terminated with an error is returned.
Success! The macro play was successful.
MacroFileName The name of the macro file to play.
[Options] Options affecting how the macro is played. If missing, Wait! is used.
Wait! Wait for the play to complete. If neither Wait! or DontWait! is specified, then Wait! is used.
DontWait! Don't wait for the play to finish. If neither Wait! or DontWait! is specified, then Wait! is used.
Debug! Play the macro with the macro debugger. This is the same as choosing the File/Debug/Play menu item in the Macro Facility.
NoPrompts! Don't display or wait for any prompts or dialogs from the macro interpreter or the macro as it plays. Prompts and dialogs are automatically dismissed with the default option for that prompt or dialog. Some prompts or dialogs are displayed before being automatically dismissed; some are displayed and then dismissed; others are not displayed. This currently does not function for ALL prompts or dialogs. It does not work for the input validity prompts in the macro debugger and in the GetNumber and GetUnits commands. User macro dialogs still need to be dismissed. The Coach... commands that display prompts are not automatically dismissed. Lastly, the NetConnectionDlg and NetDisconnectDlg tokens display dialogs that are also not automatically dismissed. The following prompts or dialogs are automatically dismissed with the following behavior:
-FileNameDialog - The initial path and initial file is returned.
-DirectoryCreate, DirectoryDelete, DirectoryRename, SetFileAttributes, FileCopy, FileDelete, FileRename - The Prompts parameter is set to NoPrompt!.
-MessageBox - The default button is pressed.
-GetNumber, GetUnits, GetString - The OK button is pressed and the initial values are returned.
-Pause, Prompt - The pause command does not pause, and so it is as if the OK button on the Prompt is pressed.
-Menu, MenuList - The first menu pick is selected.
-Runtime error dialog - The QUIT (or OK) button is pressed.
-Elapsed time dialog - This dialog is not displayed.
ShowProgress! If a macro must be compiled before it is played, display the compile progress and compilation summary dialogs during the compile.
ShowIcon! Show an icon in the Windows system tray area while this macro is being played. This option only has an effect if the PerfectScript advanced/hidden setting "Show Tray Icons" is turned off, since a tray icon is normally always displayed. If it is turned off, then tray icons are not displayed, and then this option causes the icon to be displayed.
DebugMode! Cause the PerfectFit macro interpreter to run in internal debug mode. This causes some additional prompts to be displayed when certain conditions are detected.
[{Parameter}] A repeating parameter of values to be passed to the macro. These parameters are passed in the MacroArgs[ ] array variable.
Bugs Fixes and Corrections
- PerfectScript is never made the parent of a modal macro dialog to prevent PerfectScript from being modally blocked.
- Statements on the same line after the end of a block comment statement (*/) were being ignored.