- PPSR > Built-in Commands

- Overview
- Powerpro's built-in commands allow manipulation of running programs & windows, plus control of the Windows interface.
- General Syntax
- Command.Action(arg1, arg2, ..., argn)
- Commands
- Bar
- Overview
- Bars are groups of buttons, created either as a command list in the PPConfig dialog or with scripts. Bars can be manipulated, altered or repositioned using the Bar actions.
- Actions
- Close
- Description
- Closes a bar and removes it from memory.
- Syntax
- Parameters
- Examples
- Bar.Close("activeBar")
- Closes the bar named "activeBar".
- Format
- Description
- Syntax
- Bar.Format(barname, sKeywords)
- Parameters
- barname
- (string) name of the bar to format
- sKeywords
- (string) any combination of the format keywords as a space-separated list
- Possible Values
- autohide n
- where n=number of milliseconds to hide after
- Note that "Show if bump" in the PPConfig Command List Properties window must be set to something other than "None", otherwise the bar will not appear on screen edge bump.
- back bgImgPath
- where bgImgPath=path to the background image, using forward slashes as the path delimiter, & in quotes. Since the parameter sKeywords is itself in quotes, the inner pair must be escaped.
- Changes the background to file.bmp or use back none to remove background; put file name in double quotes if it contains blanks.
- Use with "back2" to toggle between two backgrounds each time the command is executed.
- Use "back none" to specify no background image.
- Always add the "refresh" keyword when changing a bar's background, in order to show the change.
- back2 bgImgPath
- position n
- Position n is the nth item in the menu of positions that appears in PPCD drop-down for Bar Position. There are 23 possible values for n:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- refresh
- Closes & reopens the bar.
- Use with "back", "back2" & "position" keywords to see the changes.
- Examples
- Bar.Format("DocsBar", "autohide 500")
- Sets the bar named "DocsBar" to automatically hide after 500ms when the mouse is moved off it.
- Bar.Format("DocsBar", "autohide -500")
- Toggles the bar named "DocsBar" between automatically hiding after 500ms when the mouse is moved off it, and not automatically hiding.
- Bar.Format("Links", "back \"C:/graphics/lines.bmp\" refresh")
- Each time this command is called, it will toggle the background of bar "Links" between "c:\graphics\lines.bmp" and no background.
- Bar.Format("Links", "back \"C:/graphics/lines.bmp\" back2 none refresh")
- Each time this command is called, it will toggle the background of bar "Links" between "c:\graphics\lines.bmp" and no background.
- Bar.Format("Places", "position 22 refresh")
- Sets the bar named "Places" to be above the active window.
- Bar.Format("Places", "position -23 refresh")
- Toggles the bar named "Places" between its current position & being positioned "Below active", refreshing it to show the change.
- Notes
- The resulting new bar configuration is always saved in the .pcf file.
- Hide
- Description
- Hides a bar but keeps it in memory (for faster reshow).
- Syntax
- Parameters
- barname
- (string) name of the bar to format
- Examples
- Bar.Hide("Tools")
- Hides the bar named "Tools".
- HideShow
- Description
- Hides a bar if visible; shows it otherwise.
- Syntax
- Parameters
- barname
- (string) name of the bar to format
- Examples
- Bar.HideShow("Tools")
- Toggles the visibility of the bar named "Tools", showing it if it's hidden & hiding it otherwise.
- Keys
- Description
- Readies bar to receive keys.
- Syntax
- Parameters
- barname
- (string) name of the target PowerPro bar
- Keystrokes
- left arrow
- right arrow
- up arrow
- move to next row in multi-row bar
- down arrow
- move to previous row in multi-row bar
- esc
- return mouse cursor to position preceding the Bar.Keys() command
- enter
- left-click current button
- ctrl+enter
- L
- left-click current button
- M
- middle-click current button
- R
- right-click current button
- tab
- home
- end
- Examples
- Bar.Keys("myBar")
- Moves the mouse to the start of the bar named "myBar".
- SelectSubBar
- Description
- Shows the specified subbar on a PowerPro bar, hiding any other subbars.
- Syntax
- Bar.SelectSubBar("barname @subbarname")
- Parameters
- barname
- (string) name of the bar containing the subbar to show
- subbarname
- (string) name of the subbar to show
- Examples
- Bar.SelectSubBar("PPBar @sub1")
- Shows subbar "sub1" on bar "PPBar".
- See Also
- A "subbar" is a portion of a PowerPro bar. For more info on subbars, see:
- PowerPro Help CHM > Miscellaneous Usage Topics > "Displaying different subsets of a bar" for more information.
- To get the name of the currently selected subbar, use the built-in PowerPro function subbarname. See:
- PPSR > Built-in Functions > by Category > PowerPro > subbarname
- SelectSubBarToButton
- Description
- Shows the specified subbar aligned to the bar button pressed most recently.
- Syntax
- Bar.SelectSubBarToButton("barname @subbarname")
- Parameters
- barname
- (string) name of the bar containing the subbar to show
- subbarname
- (string) name of the subbar to show
- Examples
- Bar.SelectSubBarToButton("Test @subbar1")
- Shows the subbar "subbar1" from bar "Test" aligned to the button just pressed.
- Notes
- The subbar is shown aligned with the bottom of the pressed button.
- If the button pressed is on the same bar as subbarname, the bar is redraws itself at the location of the pressed button.
- If there are commands not within a subbar on the bar specified by barname, they are also shown when the subbar part of the bar is shown.
- See Also
- To get the name of the currently selected subbar, use the built-in PowerPro function subbarname. See:
- PPSR > Built-in Functions > by Category > PowerPro > subbarname
- SelectSubBarToMouse
- Description
- Shows the specified subbar aligned to the mouse.
- Syntax
- Bar.SelectSubBarToMouse("barname @subbarname")
- Parameters
- barname
- (string) name of the bar containing the subbar to show
- subbarname
- (string) name of the subbar to show
- Examples
- Bar.SelectSubBarToMouse("Test @subbar1")
- Shows the subbar "subbar1" from bar "Test" aligned to the mouse.
- See Also
- The Notes & See Also sections for SelectSubBarToButton above.
- Show
- Description
- Shows a bar, optionally using slide animation to do so.
- Syntax
- Bar.Show(barname)
- Bar.Show("*keyword", barname)
- shows bar "barname" with settings given by "*keyword"
- Parameters
- *keyword
- (string) slide direction and/or mouse position
- Possible Values
- Type: Slide animations
- "*vertical"
- Powerpro determines the slide direction depending on which half of the screen the mouse is positioned in, top or bottom.
- "*horizontal"
- Powerpro determines the slide direction depending on which half of the screen the mouse is positioned in, left or right.
- "*fromtop"
- "*frombottom"
- Bar slides in from bottom.
- "*fromleft"
- "*fromright"
- Bar slides in from right.
- "*none"
- Removes any preset slide animation.
- Type: Mouse-related
- "*move"
- The mouse cursor is positioned over the bar.
- "*move" can be combined with a slide direction keyword in the same Bar.Show() call, in either order.
- barname
- (string) name of the bar to show
- Examples
- Bar.Show("*vertical", "ActiveWindows")
- Shows the bar named "ActiveWindows" sliding down from the top if the mouse is in the top half of the screen, and sliding up from the bottom if the mouse is in the bottom half of the screen.
- Bar.Show("*move *vertical", "ActiveWindows")
- Shows the bar named "ActiveWindows" sliding down from the top if the mouse is in the top half of the screen, and sliding up from the bottom if the mouse is in the bottom half of the screen, and moves the mouse to the start of the bar.
- Notes
- Only works with Windows 98, 2000 and later.
- The Command Lists > Setup checkbox "Use slide animation" does not have to be checked for the Bar.Show() command to work.
- ToMouse
- Description
- Temporarily moves the specified bar to the mouse, showing it if hidden.
- Syntax
- Parameters
- barname
- (string) name of the bar to move
- Examples
- Bar.ToMouse("Test")
- Moves the bar named "Test" to the mouse.
- Notes
- Only works with bars that have position: Floating.
- Usually used with a PowerPro hotkey.
- Clip
- Overview
- The Clip command is used to work with the clipboard, with actions for manipulating, tracking & editing of the system clipboard.
- Actions
- Capture
- Description
- Sets PowerPro's clipboard history tracking state.
- Syntax
- Clip.Capture(keyword[, pathOrRefresh])
- Parameters
- keyword
- (string) action to perform
- Possible Values
- on
- Turns clipboard history tracking on.
- off
- Turns clipboard history tracking off.
- reverse
- Toggles the state of clipboard history tracking.
- pathOrRefresh
- (string) specifies either a folder path or the keyword "refresh"
- Optional.
- Possible Values
- a folder path
- Changes PowerPro's clip capture storage folder to the specified folder.
- refresh
- Resets PowerPro's internal memory copy of clip files and dates.
- Used if a new text file is inserted into the clip folder without using clip capture.
- Examples
- Clip.Capture("on")
Win.Debug(cliptrackon)
- Turns clip tracking on, then debugs the state of clip history tracking.
- The debug window would show 0.
- Clip.Capture("reverse")
- Toggles the state of PowerPro's clip history tracking, turning it on if it is off, & off if it is on.
- Clip.Capture("on c:/web/cliptest")
- Sets the clip tracking folder to the specified path, which is defined with forward slashes as folder separators.
- Clip.Capture(?"on c:\web\cliptest")
- Sets the clip tracking folder to the specified path, which is defined with backslashes as folder separators using ?c..c syntax.
- Clip.Capture(?"on c:\program files\powerpro\clip")
- Sets the clip tracking folder to PowerPro's default clip folder.
- Clip.Capture("on "++pprofolder++"clip")
- Also sets the clip tracking folder to PowerPro's default clip folder.
- Clip.Capture("on refresh")
- Resets PowerPro's internal clips memory.
- Clip.Capture("off")
File.AllFiles(path,"Clip.FilePaste(\"|\\n\\n\")")
Clip.Capture("on")
- Turns clip tracking off, performs a clip intensive operation, then turns clip tracking back on again, eliminating the overhead from PowerPro updating its clip folder & memory for each file during the process.
- Notes
- PowerPro clip history tracking is initially on, by default.
- ClearClip
- Description
- Syntax
- Examples
Notes
- ClearRecent
- Description
- Clear PowerPro's list of recently captured clips.
- Syntax
- Examples
- Copy
- Description
- Copies the selected text by sending Ctrl-C to the foreground window.
- Syntax
- Examples
- Notes
- Clip.Copy doesn't actually return the selected text to the calling PowerPro script -- it just places the text on the clipboard.
- CopyThenToFile
- Description
- Send Ctrl-C to copy the selected text, then copies the clipboard contents to a file.
- Syntax
- Clip.CopyThenToFile(filepath)
- Parameters
- filepath
- (string) path to the target file
- Must be a full filepath including file name & extension.
- Examples
- Clip.CopyThenToFile("c:/web/out.txt")
- Copies the selected text to the clipboard, then to the file "out.txt".
- Notes
- PowerPro will only copy plain text across to the file, removing any rich text or other formatting from the selection.
- Cut
- Description
- Cuts the selected text by sending Ctrl-X to the foreground window.
- Syntax
- Examples
- Notes
- Clip.Cut doesn't actually return the cut text to the calling PowerPro script -- it just cuts the text (if it can) from the foreground window & places it on the clipboard.
- Delete
- Description
- Shows the clipboard history list, then deletes the entry selected by the user.
- Syntax
- Examples
- File
- Description
- Copies a file to the clipboard.
- Syntax
- Parameters
- filepath
- (string) path to the target file
- Examples
- Clip.File(?"c:\web\out.txt")
- Puts the contents of the file "out.txt" onto the clipboard.
- FilePaste
- Description
- Copies a file to the clipboard, then pastes it by sending Ctrl-V to the foreground window.
- Syntax
- Parameters
- filepath
- (string) path to the target file
- Examples
- Clip.FilePaste(?"c:\web\out.txt")
- Puts the contents of the file "out.txt" onto the clipboard, then pastes it to the active window.
- FileIPaste
- Description
- Copies a file to the clipboard, then pastes it by sending Ctrl-Ins to the foreground window.
- Syntax
- Clip.FileIPaste(filepath)
- Parameters
- filepath
- (string) path to the target file
- Examples
- Clip.FileIPaste(?"c:\web\out.txt")
- Puts the contents of the file "out.txt" onto the clipboard, then pastes it to the active window.
- Notes
- This command has an "i" in it.
- LongDate
- Description
- Puts the date onto the clipboard in the system's long date format.
- Syntax
- Examples
- Menu
- Description
- Shows a menu of recently captured clips (or, optionally, a menu of clips from another folder), allowing user to select an entry to put on the clipboard.
- Syntax
- Parameters
- foldername
- (string) name of the folder to show clips from
- Optional, default is the current PowerPro clip capture folder (usually the "clip" folder under the PowerPro installation directory).
- Examples
- Clip.Menu
- Shows a menu of recent clips & puts selection onto clipboard.
- Clip.Menu("work")
- Shows a menu of the clips from the folder "work" (a subfolder of the current clip capture folder) & pastes the selection to the active window.
- Note
- Clip.Menu does not paste the selected entry -- use Clip.MenuPaste or Clip.MenuIPaste for that.
- See Also
- For more information on setting up subfolders for permanent clip storage, see:
- PowerPro Help CHM > Configuring with the GUI Dialogs > Clip Filters
- MenuPaste
- Description
- Shows a menu of recently captured clips (or, optionally, a menu of clips from another folder), & the selected entry is put onto the clipboard then pasted into the active window using Ctrl-V.
- Syntax
- Clip.MenuPaste(foldername)
- Parameters
- foldername
- (string) Name of the folder to show clips from, which must be a subfolder of the current clip capture folder.
- Optional, default is the current PowerPro clip capture folder (usually the "clip" folder under the PowerPro installation directory).
- Examples
- Clip.MenuPaste
- Shows a menu of recent clips & pastes selection to active window.
- Clip.MenuPaste("work")
- Shows a menu of the clips from the clip subfolder "work" & pastes the selection to the active window.
- See Also
- For more information on setting up subfolders for permanent clip storage, see:
- PowerPro Help CHM > Configuring with the GUI Dialogs > Clip Filters
- MenuIPaste
- Description
- Shows a menu of recently captured clips (or, optionally, a menu of clips from another folder), & the selected entry is put onto the clipboard then pasted into the active window using Ctrl-Ins.
- Syntax
- Clip.MenuIPaste(foldername)
- Parameters
- foldername
- (string) Name of the folder to show clips from, which must be a subfolder of the current clip capture folder.
- Optional, default is the current PowerPro clip capture folder (usually the "clip" folder under the PowerPro installation directory).
- Examples
- Clip.MenuIPaste
- Shows a menu of recent clips & inserts selection in active document.
- Clip.MenuIPaste("work")
- Shows a menu of the clips from the clip subfolder "work" & inserts the selection to the active window.
- Notes
- Note that this keyword contains an added letter "i".
- See Also
- For more information on setting up subfolders for permanent clip storage, see:
- PowerPro Help CHM > Configuring with the GUI Dialogs > Clip Filters
- Reattach
- Description
- Puts PowerPro at the front of the queue of applications tracking clipboard history.
- Syntax
- Examples
- Paste
- Description
- Sends Ctrl-V to the foreground window to paste the clipboard's contents.
- Syntax
- Examples
- ShortDate
- Description
- Puts the date onto the clipboard in the system's short date format.
- Syntax
- Examples
- Text
- Description
- Puts specified text onto the clipboard.
- Syntax
- Parameters
- sText
- (string) a single line of text
- Examples
- Clip.Text(exefullpath)
- Puts the full path to exe for the current foreground window onto the clipboard.
- Clip.Text("quick brown fox")
- Puts the string "quick brown fox" onto the clipboard.
- Notes
- This command can only work with a single line of text. Use the Clip plugin to work with multiple lines of text.
- TextAppend
- Description
- Appends specified text to the clipboard.
- Syntax
- Parameters
- sText
- (string) a single line of text
- If sText is empty (""), a new line is appended to the clipboard.
- Examples
- Clip.TextAppend(currentdir)
- Appends the current working directory path of the active window to the clipboard.
- Clip.TextAppend("")
- Appends a new line character to the clipboard.
- Notes
- This command can only work with a single line of text. Use the Clip plugin to work with multiple lines of text.
- TextPaste
- Description
- Put specified text onto the clipboard, and then pastes it to the active window with Ctrl-V.
- Syntax
- Parameters
- sText
- (string) a single line of text
- Examples
- Clip.TextPaste(pprofolder)
- Puts PowerPro's folder path to the clipboard then pastes it to the active window.
- Notes
- This command can only work with a single line of text. Use the Clip plugin to work with multiple lines of text.
- For long text strings, a Clip.TextPaste() command will often be faster than a Win.Keys() command to paste into the current document.
- Time
- Description
- Puts the current time onto the clipboard.
- Syntax
- Examples
- ToFile
- Description
- Copies the clipboard's contents to the specified text file.
- Syntax
- Parameters
- fpath
- (string) path to the target file
- Examples
- Clip.ToFile(?"c:\docs\stuff.txt")
- Copies the clipboard to "stuff.txt".
- Notes
- The entire contents of the text file are replaced by the clipboard contents.
- ToFileAppend
- Description
- Appends the clipboard's contents to the specified text file.
- Syntax
- Parameters
- fpath
- (string) path to the target file
- Examples
- Clip.ToFileAppend(?"c:\docs\stuff.txt")
- Appends the clipboard to the contents of the file "stuff.txt".
- Write
- Description
- Sets the state of writing of clips to memory.
- Syntax
- Parameters
- keyword
- (string) new setting for Clip writing functionality
- Possible Values
- "off"
- "on"
- "reverse"
- toggles clip writing state
- Examples
- Clip.Write("off")
- Turns off standard capturing of clips by PowerPro.
- Notes
- This command would be used if another clip management system was implemented by using the special ClipCaptured command list.
- See Also
- PPSR > Plugins > The Plugins > Clip
- See Also
- For more information on PowerPro's clipboard tracking features, see:
- PowerPro Help CHM > Built-in Commands > *Clip
- PowerPro Help CHM > Configuring with the GUI Dialogs > Clip Filters
- PowerPro Help CHM > Configuring with the GUI Dialogs > Clipboard History Tracking
- Most of the functions of the built-in Clip command work only with the first line of the clipboard. For information on working with multi-line clipboard strings, see:
- PPSR > Plugins > The Plugins > Clip
- Configure
- Overview
- Allows import & export of PowerPro configuration files.
- Actions
- CommandLists
- Description
- Starts the PowerPro Config GUI at the CommandLists tab.
- Syntax
- Examples
- GUI
- Description
- Starts the PowerPro Config GUI at the GUI tab.
- Syntax
- Examples
- ImportCL
- Description
- Imports specified command list configuration text file into the current PowerPro configuration.
- Syntax
- Configure.ImportCL(inifile)
- Parameters
- inifile
- (string) name of the .ini file, optionally with path & .ini extension
- If inifile does not include the full path, then the file is assumed to be in the "config" subfolder of the folder containing the current .pcf file.
- Optional; if omitted, a PowerPro file browse dialog is shown.
- Examples
- Configure.ImportCL
- Shows a file browse dialog for selection of the config file to import.
- Configure.ImportCL(pprofolder++?"backups\lists.ini")
- Imports the file lists.ini, which is located in "backups" under PowerPro's installation folder.
- Configure.ImportCL("list")
- Imports the command list config file "lists.ini", which is located in the "config" subfolder of PowerPro's installation folder.
- See Also
- PowerPro Help CHM > Configuring with text files > Maintaining configuration using .ini files > Importing text configurations with commands
- ImportHot
- Description
- Imports specified hotkeys configuration text file into the current PowerPro configuration.
- Syntax
- Configure.ImportHot(inifile)
- Parameters
- inifile
- (string) name of the .ini file, optionally with path & .ini extension
- If inifile does not include the full path, then the file is assumed to be in the "config" subfolder of the folder containing the current .pcf file.
- Optional; if omitted, a PowerPro file browse dialog is shown.
- Examples
- Configure.ImportHot
- Shows a file browse dialog for selection of the hotkeys config file to import.
- Configure.ImportHot(pprofolder++?"backups\hotkeys.ini")
- Imports the file hotkeys.ini, which is located in "backups" under PowerPro's installation folder.
- Configure.ImportHot("hotkeys")
- Imports the hotkeys config file "hotkeys.ini", which is located in the "config" subfolder of PowerPro's installation folder.
- See Also
- PowerPro Help CHM > Configuring with text files > Maintaining configuration using .ini files > Importing text configurations with commands
- ImportSched
- Description
- Imports specified scheduled events configuration text file into the current PowerPro configuration.
- Syntax
- Configure.ImportSched(inifile)
- Parameters
- inifile
- (string) name of the .ini file, optionally with path & .ini extension
- If inifile does not include the full path, then the file is assumed to be in the "config" subfolder of the folder containing the current .pcf file.
- Optional; if omitted, a PowerPro file browse dialog is shown.
- Examples
- Configure.ImportSched
- Shows a file browse dialog for selection of the scheduled events config file to import.
- Configure.ImportSched(pprofolder++?"backups\events.ini")
- Imports the file events.ini, which is located in "backups" under PowerPro's installation folder.
- Configure.ImportSched("events")
- Imports the scheduled events config file "events.ini", which is located in the "config" subfolder of PowerPro's installation folder.
- See Also
- PowerPro Help CHM > Configuring with text files > Maintaining configuration using .ini files > Importing text configurations with commands
- Media
- Description
- Starts the PowerPro Config GUI at the Media tab.
- Syntax
- Examples
- NewReminderMessage
- Description
- Starts the PowerPro Config GUI & opens an "Edit scheduled command" dialog preset to create a scheduled message.
- Syntax
- Configure.NewReminderMessage
- Examples
- Configure.NewReminderMessage
- Scheduler
- Description
- Starts the PowerPro Config GUI at the Scheduler tab.
- Syntax
- Examples
- Setup
- Description
- Starts the PowerPro Config GUI at the Setup tab.
- Syntax
- Examples
- Timers
- Description
- Starts the PowerPro Config GUI at the Timers tab.
- Syntax
- Examples
- WriteAllToPCF
- Description
- Write the entire current PowerPro configuration, including any imported text files, to a .pcf file.
- Syntax
- Configure.WriteAllToPCF(pcfpath)
- Parameters
- pcfpath
- (string) name of the target .pcf file, including path
- Optional; if omitted, a PowerPro file Save As prompt will be shown.
- Examples
- Configure.WriteAllToPCF
- Shows a PowerPro file prompt for the .pcf file to save to, then writes to it the current configuration.
- Configure.WriteAllToPCF(pprofolder++?"backups\"++date++".pcf")
- Writes the current configuration to a .pcf file in the "backups" directory of PowerPro's installation directory, named with the current date.
- Notes
- This command is intended to help debug text imports by showing what has been imported to memory.
- The saved configuration file can be viewed using the pproconf program.
- Notes
- The Key/Mouse tab cannot be opened using the new Expression syntax. Instead, use:
*Configure Key/Mouse
- See Also
- For more detailed information on using .ini configuration files & the rules PowerPro uses when importing them, see:
- PowerPro Help CHM > Configuring with text files > Maintaining configuration using .ini files
- For more information on configuring PowerPro, see:
- PowerPro Help CHM > Configuring with the GUI dialogs
- Desktop
- Overview
- The Desktop command is used to control various aspects of the Windows desktop layout.
- Actions
- HideIcons
- Description
- Hides all icons on the desktop.
- Syntax
- Examples
- HideTaskBar
- Description
- Hides the Windows TaskBar.
- Syntax
- Examples
- HideShowIcons
- Description
- Toggles the visibility of the desktop icons.
- Syntax
- Examples
- HideShowTaskBar
- Description
- Toggles the visibility of the Windows TaskBar.
- Syntax
- Examples
- HideShowWindows
- Description
- Toggles display of all windows on the desktop.
- Syntax
- Examples
- Notes
- Desktop window visibility is toggled for all windows together as a group, not individually. (So, all are shown, or all or hidden.)
- IconTextColor
- Description
- Set color of text under desktop icons; use the TransIconText auto function to reset color when background changes
- Syntax
- Desktop.IconTextColor(r,g,b)
- Desktop.IconTextColor("r g b")
- Parameters
- r, g & b
- either:
- (integer) 3 comma-separated integer values:
- (string) a space-separated string of 3 integers representing an rgb color value
- Examples
- Desktop.IconTextColor(0,0,0)
- Changes desktop icon text color to black.
- Desktop.IconTextColor("0 0 0")
- Also changes desktop icon text color to black.
- Desktop.IconTextColor(255, 255, 255)
- Changes desktop icon text color to white.
- MinShowWindows
- Description
- Toggles the minimised state of all windows on the desktop.
- Syntax
- Examples
- Notes
- Desktop windows are toggled as a group, not individually.
- RestoreIcons
- Description
- Restores the relative positions of desktop icons
- Syntax
- Desktop.RestoreIcons(filename)
- Parameters
- filename
- (string) name of the icon positions file, including the ".iconpos" extension
- Examples
- Desktop.RestoreIcons("deskicons.iconpos")
- Restores icon positions from the file "c:\program files\powerpro\deskicons.iconpos".
- Notes
- All .iconpos files are kept in the Powerpro folder.
- See Also
- PowerPro Help CHM > Built-in Commands > *Desktop > Saving and restoring desktop icon positions
- Resolution
- Description
- Changes screen display resolution.
- Syntax
- Desktop.Resolution(w, h, depth, freq, nosave)
- Changes display resolution to w*h with specified depth & frequency.
- Desktop.Resolution (w1, h1, w2, h2, nosave)
- Toggles display resolution between w1*h1 and w2*h2.
- Parameters
- w
- (integer) new horizontal pixels
- h
- (integer) new vertical pixels
- depth
- (integer) new color depth
- Optional.
- Possible Values
- freq
- (integer) new refresh frequency
- Optional.
- Works on Windows NT only.
- w1
- (integer) 1st horizontal pixels setting, for toggling between two resolutions
- h1
- (integer) 1st vertical pixels setting, for toggling between two resolutions
- w2
- (integer) 2nd horizontal pixels setting, for toggling between two resolutions
- h2
- (integer) 2nd vertical pixels setting, for toggling between two resolutions
- nosave
- (string) stops new desktop settings being saved to the Windows Registry
- Optional, default is that settings are saved.
- Possible Values
- Examples
- Desktop.Resolution(1024, 768, 4, 300, "nosave")
- Changes display resolution to 1024x768
- Desktop.Resolution (1024, 768, 800, 600)
- Toggles display resolution between 1024x768 and 800x600.
- See Also
- PowerPro Help CHM > Built-in Commands > *Desktop > Changing screen display resolution
- SaveIcons
- Description
- Saves the relative positions of the desktop icons.
- Syntax
- Desktop.SaveIcons(filename)
- Parameters
- filename
- (string) name of the icon positions file, including the ".iconpos" extension
- Examples
- Desktop.SaveIcons("deskicons.iconpos")
- Notes
- All .iconpos files are kept in the Powerpro folder.
- See Also
- PowerPro Help CHM > Built-in Commands > *Desktop > Saving and restoring desktop icon positions
- SaveIconsGrid
- Description
- Aligns icons according to a grid & optionally also saves their relative position details to a file.
- Syntax
- Desktop.SaveIconsGrid (xSpacing, ySpacing[, filename])
- Parameters
- xSpacing
- (integer) horizontal grid spacing
- ySpacing
- (integer) vertical grid spacing
- filename
- (string) name of the icon positions file, including the ".iconpos" extension
- Optional, default is to not save position details to a file but to just align the icons.
- Examples
- Desktop.SaveIconsGrid(30, 20)
- Aligns the desktop icons according to a grid with a relative horizontal spacing factor of 30 & a relative vertical spacing factor of 20.
- Desktop.SaveIconsGrid(30, 20, "deskicons.iconpos")
- Aligns the desktop icons according to a grid with a relative horizontal spacing factor of 30 & a relative vertical spacing factor of 20, then saves the icons' relative positions to the file "deskicons.iconpos".
- Notes
- All .iconpos files are kept in the Powerpro folder.
- Positions are stored as numbers that are independent of screen resolution. This enables relative icon positions to be maintained under different screen resolutions.
- See Also
- PowerPro Help CHM > Built-in Commands > *Desktop > Saving and restoring desktop icon positions
- SetWorkArea
- Description
- Sets the size of the maximum work area on the desktop screen.
- Syntax
- Desktop.SetWorkArea(left, top, bottom, right)
- Desktop.SetWorkArea("left top bottom right")
- Parameters
- left
- (integer) left screen coordinate
- top
- (integer) top screen coordinate
- bottom
- (integer) bottom screen coordinate
- right
- (integer) right screen coordinate
- Examples
- Desktop.setWorkArea("0 0 1024 747")
- Sets work area to the rectangle bounded by top left coord (0,0) and bottom right coord (1024, 747).
- Notes
- The desktop work area is equivalent to the space taken up by a maximized window.
- See Also
- PPSR > Plugins > The Plugins > Win > System > SetWorkArea
- ShowIcons
- Description
- Syntax
- Examples
- ShowTaskBar
- Description
- Shows the Windows TaskBar.
- Syntax
- Examples
- ShowTaskBarAutoHide
- Description
- Shows the TaskBar, then re-hides it when the mouse is moved away & the TaskBar is not the foreground window.
- Syntax
- Desktop.ShowTaskBarAutoHide
- Examples
- Desktop.ShowTaskBarAutoHide
- Notes
- Assign this command to a hotkey that performs a screen bump in order to use an auto-hiding TaskBar but prevent inadvertent shows by movements near the screen bottom.
Some systems may also require Desktop.HideTaskBar added as a startup scheduled event.
- TransIconText
- Description
- Gives desktop icon text a transparent background, optionally also setting the icon to refresh automatically after a background change.
- Syntax
- Desktop.TransIconText(autokeyword)
- Parameters
- autokeyword
- (string) whether to automatically refresh icon transparency after background changes
- Optional.
- Possible Values
- auto
- automatically refreshes transparency
- [omitted]
- does not automatically refresh
- Examples
- Desktop.TransIconText
- Makes icon text transparent.
- Desktop.TransIconText("auto")
- Makes icon text transparent & sets icon text backgrounds to automatically refresh their transparency upon background change.
- Exec
- Overview
- The Exec command includes various functions for file, window, system, multimedia, & PowerPro manipulations.
- Actions
- Alarms
- Description
- Suspend or re-activate checks for scheduled programs.
- Syntax
- Examples
- Autoscroll
- Description
- Starts automatic window scrolling.
- Syntax
- Exec.Autoscroll(scrollspeed)
- Parameters
- scrollspeed
- (integer) sets the number of milliseconds between auto scroll steps
- Optional.
- Possible Values
- 0
- disables automatic scrolling
- scrollspeed>0
- sets scroll speed in number of milliseconds between auto scroll steps
doesn't seem to do anything?
- omitted
- Exec.Autoscroll command turns autoscrolling on without setting scroll speed
- Mouse Commands
- While the autoscroller "S" is shown, the following mouse commands apply:
- Right mouse button
- Middle mouse button
- Left mouse button
- Examples
- Exec.Autoscroll
- Enables automatic scrolling
- Exec.Autoscroll(0)
- Disable automatic scrolling but enable mouse commands (autoscroller "S" is still shown).
- See Also
- For more information on how to control autoscrolling, see:
- PowerPro Help CHM > Miscellaneous Usage Topics > Automatic scrolling with the mouse
- AutoPress
- Description
- Toggles the recognition of a window type by the mouse stop-press feature, adding it to the list of recognised window types if PowerPro does not already autopress it, or removing it if it does.
- Syntax
- UI Elements
- PowerPro shows a message box with the result of the function call when it has finished updating its autopress list.
- Examples
- Notes
- To use this feature, move the mouse over the window of interest and then activate the hot key.
- See Also
- PowerPro Help CHM > Miscellaneous Usage Topics > Mouse hover to click a dialog button
- BrowseRun
- Description
- Shows a file open dialog, & the select file is immediately executed.
- Syntax
- Examples
- CalcCalendar
- Description
- Shows a PowerPro calendar dialog with 2 date/calendar fields, along with day number, week number, and the differences between the 2 dates, allowing the user to perform date calculations.
- Syntax
- UI Elements
- PowerPro Calendar Calculator
- Date 1 dropdown
- Calendar dropdown for date selection.
- Select the day, month, or year portion of the date then use the arrow keys to scroll through the values. (Note that day of the week is not editable in this way.)
- Click on the dropdown arrow to open a month-view calendar UI with controls for moving between dates & the current date highlighted.
- Day Number textbox
- Number of days since start of year.
- Week Number textbox
- Number of weeks since start of year.
- Weeks start on a Sunday, so Date 1 will always be updated to a date that falls on this day.
- Date 2 dropdown
- Calendar dropdown for date selection.
- Days textbox
- Number of days between Date 1 and Date 2.
- Weekdays textbox
- Number of weekdays between Date 1 and Date 2.
- Weeks textbox
- Number of weeks between Date 1 and Date 2.
- <ESC> key
- Examples
- Notes
- All values in the dialog are editable, & when changed, other fields are updated accordingly.
- Unavailable on early Win95 versions unless IE3 or later has been installed.
- See Also
- PowerPro Help CHM > Built-in Commands > *Exec > Date Calculator
- Calendar
- Description
- Shows a month-view calendar with current date highlighted, along with an input field containing the current date.
- The mouse or arrow keys can be used to navigate the calendar.
- Syntax
- UI Elements
- PowerPro Calendar
- Date field
- Select the day, month, or year portion of the date then use the arrow keys to scroll through the values. (Note that day of the week is not editable in this way.)
- Click on the dropdown arrow to open the dropdown calendar.
- Calendar
- Calendar dialog for date selection with controls for moving between dates, & current date highlighted.
- Acts as a dropdown object from date field above. Initially open when function called.
- Examples
- Notes
- Unavailable on early Windows 95 versions unless IE3 or later has been installed.
- CD
- Description
- Controls the audio CD player.
- Syntax
- Parameters
- task
- (string) action to perform with the CD
- Possible Values
- "Close"
- Closes the door of the default audio CD.
- Does not work with all types of CD drawers.
- "Eject"
- Ejects (opens door for) default audio CD.
"Next"- Play next track.
Not working on this laptop..?
"Play"- Plays the CD from the start.
Not working on this laptop..?
"Play n"- Plays the CD, starting at track number n.
Not working on this laptop..?
"Previous"- Play previous track.
Not working on this laptop..?
- "Stop"
- Stops the default audio CD.
- Examples
- Notes
Uses system audio tools...? As in, not WinAmp?- There are a few good WinAmp plugins available in the Yahoo! Groups PowerPro Files section.
- I'm guessing.
- See Also
- PowerPro Help CHM > Built-in Commands > *Exec > Working with CDs
- ChangeConfiguration
- Description
- Changes to configuration stored in a different pcf file; the new file path can be entered in the command.
- Syntax
- Exec.ChangeConfiguration(pcfname)
- Parameters
- pcfname
- (string) name of to the new .pcf file
- Optional; if omitted, file is prompted for.
- Path & extension are optional. If no path is included, file is searched for in PowerPro's installation directory.
- Examples
- Exec.ChangeConfiguration("subbars")
- Changes to the PowerPro "subbars" configuration.
- Exec.ChangeConfiguration("pproconf")
- Changes back to the PowerPro's standard "pproconf.pcf" config file.
- Exec.ChangeConfiguration(?"c:\path\to\saved.pcf")
- Changes to a config file "saved.pcf" at path given.
- ClearRecent
- Description
- Clears the Windows Recent folder for the current user.
- Syntax
- Examples
- Notes
- Contents of the Recent folder can be displayed on the Start Menu, or found at "C:\Documents and Settings\<username>\Recent".
- ClearRecentExplorer
- Description
- Clears the list of recent windows shown by a Menu.Explorer call.
- Syntax
- Examples
- Notes
- "Track Explorer" in PPConfig > Setup must be checked, or PowerPro will return an error.
- See Also
- PPSR > Built-in Commands > Commands > Menu > Explorer
- PowerPro Help CHM > Built-in Commands > *Menu > Working with Explorer windows
- CommandLine
- Description
- Shows a tiny command line allowing the user to enter a command that will be run, as with Windows' Start > Run dialog.
- Syntax
- Exec.CommandLine(ac_keywords)
- Parameters
- ac_keywords
- (string) any combination of the following keywords, as a space-separated string
- Script calls cannot combine "urlhistory" or "urlrecent" with "history" or "=vecname".
- Optional.
- Possible Values
- "file"
- autocomplete using file and shell folder names
- "urlhistory"
- autocomplete using history URL
- "urlrecent"
- autocomplete using URL most recently used
- "history"
- autocomplete using the history in the dropdown of the edit box
- =vecname
- where "vecname" is a vector containing strings for autocompletion
- UI Elements
- "PowerPro run" dialog
- Contains one input field for entering command line calls.
- Context menu of other options & commands.
- Examples
- Exec.CommandLine
- Opens a Tiny Type & Run box.
- Exec.CommandLine("file")
- Opens a Tiny Type & Run box that allows autocompletion with file and shell folder names.
- Exec.CommandLine("file urlhistory urlrecent")
- Opens a Tiny Type & Run box that allows autocompletion with file and shell folder names, recently used URL's, and URL's in the system's URL history.
- global vAutos = Vec.CreateFromWords("folder file document")
Exec.CommandLine("=vAutos")
- Opens a Tiny Type & Run box that allows autocompletion with the words "folder", "file", & "document".
- Notes
- Only one dialog using autocomplete can be active at a time.
- The Tiny Type & Run box stays open after executing its command. It must be manually shut, possibly via its close button or context menu, or with a Window.Close_("PowerPro run") command, best not called from the same script otherwise the box will open then close again straight away.
- See Also
- PowerPro Help CHM > Built-in Commands > *Exec > Tiny Type and Run Box
- PowerPro Help CHM > Miscellaneous Usage Topics > Auto completion
- ContextMenu
- Description
- Shows the right-click menu of a file, folder, or the window under the mouse.
- Or you can specify a file or folder to get the context menu for that file.
- Syntax
- Exec.ContextMenu(path_or_obj)
- Parameters
- path_or_obj
- (string) either:
- path to a file or folder
- name of an object from the Desktop or My Computer virtual folders
- Optional.
- If this parameter is representing an object, the same name must be used as is seen when the object is viewed in Explorer. (e.g. "My Documents")
- Examples
- Exec.ContextMenu
- Shows the context menu of the window under the mouse.
- Note this will not work with all programs. Some that don't work include:
- Exec.ContextMenu(?"c:\program files\powerpro\scripts\test.powerpro")
- Shows the context menu for the file "test.powerpro", taken as if it were being viewed in Explorer.
- Exec.ContextMenu(?"c:\program files\powerpro\scripts")
- Shows the context menu for the file "test.powerpro", taken as if it were being viewed in Explorer.
- Exec.ContextMenu("My Computer")
- Notes
- To close a PowerPro-created context menu, click the menu header (bold text bit), then click away.
PowerPro Help recommends following this command with a
Win.Keys("{to menu}…")
command to select an entry from the menu, but it doesn't seem to be working..?
- Disable
- Description
- Disables PowerPro until the mouse is moved over a PowerPro bar, or a PowerPro hot key is pressed.
- Syntax
- Example
- Dos
- Description
- Starts Dos, runs a command line, & restarts Windows.
- Syntax
Exec.Dos
Examples
Exec.Dos
- Notes
- Does not work on Windows NT.
Not working? Getting error: "Function does not work without standard explorer."
- EmptyRecycleBin
- Description
- Syntax
- Examples
- Notes
- Unavailable on early Win95 versions unless IE4 or later has been installed.
- When entering this command via the old syntax in the PPConfig Command Edit dialog, the checkboxes can be used to control action confirmation, sound & animation.
- Explorer
- Description
- Opens the specified folder in a single-paned Explorer window.
- Syntax
- Exec.Explorer(folderpath)
- Parameters
- folderpath
- (string) path to the folder to show
- Possible Values
- a file folder
- a special folder:
- Application Data
- Cookies
- Control Panel
- Desktop
- Favorites
- Local Settings
- My Computer
- My Documents
- NetHood
- PrintHood
- Recent
- SendTo
- Start Menu
- Templates
- *
- represents the current working directory of active program
- Examples
- Exec.Explorer(?"c:\web")
- Opens an Explorer window at "c:\web".
- Exec.Explorer("My Documents")
- Opens an Explorer window at the current user's My Documents directory.
- Exec.Explorer("*")
- Opens an Explorer window at the active program's current working directory.
- See Also
- PowerPro Help CHM > Built-in Commands > *Exec > *Exec commands
- Explorer2
- Description
- Opens the specified folder in a dual-paned Explorer window.
- Syntax
- Exec.Explorer2(folderpath)
- Parameters
- folderpath
- (string) path to the folder to show
- Possible Values
- Examples
- Exec.Explorer2(?"c:\docs")
- Opens a dual-paned Explorer window at "c:\docs".
- Exec.Explorer2("Control Panel")
- Opens a dual-paned Explorer window at the current user's Control Panel directory.
- FindFiles
- Description
- Shows the Windows Find Files dialog.
- Syntax
- Examples
- Exec.FindFiles
- Opens a Find Files dialog.
- Exec.FindFiles
Wait.For(1500)
Win.Keys("%n*.txt")
- Opens a Find Files dialog & sets the "Named" field to "*.txt".
- Exec.FindFiles
Wait.For(1500)
Win.Keys("%lc:\path;d:\p2%n*.txt")
- Opens a Find Files dialog, setting the "Look In" field to "c:\path;d:\p2" & the "Named" field to "*.txt".
- Notes
- Follow an Exec.FindFiles call with a Win.Keys() command to initialise dialog fields, as in the examples above.
- FindComputer
- Description
- Shows the Windows Find Computer dialog.
- Syntax
- Examples
- HideWindow
- Description
- Allows user to click a window to hide it.
- Syntax
- UI Elements
- Info dialog titled "PowerPro Hide Window", with help on using the feature & an option to Cancel the call.
- Examples
- See Also
- PowerPro Help CHM > Built-in Commands > *Exec > Hiding windows with *Exec
- HotKeys
- Description
- Suspends or re-activates all or particular hotkeys.
- Syntax
- Exec.Hotkeys(keyword[, hotkeys][, id])
- Parameters
- keyword
- (string) action to take with hotkeys
- Possible Values
- hotkeys
- (string) A space-separated list of hotkey names -- only names in this list will be acted on by the Exec.Hotkeys() command.
- Optional, if omitted, all hotkeys are affected.
- id
- (string) written as "<id=xxx>" where "xxx" is the ID name
- Optional.
- Examples
- Exec.Hotkeys("on")
- Exec.Hotkeys("off", "screentopright Semi+d")
- Turns off the hotkeys "screentopright" & "Semi+d".
- Exec.Hotkeys("reverse")
- Toggles hotkeys on or off.
- Notes
- A hotkey which runs this command will still work when hotkeys are suspended.
- If a hotkey has been disabled via the PowerPro Config dialog, it cannot be re-enabled with this function.
- Hotkey names can be found by exporting the hotkeys to an .ini file with PPConfig > Setup >Export; it is the same as the name which appears for the key in the pproconf.exe tabbed configuration dialog.
is the last part there (same as the "key") still correct?
- Hotkey names (ID's) can be defined a number of ways, such as in the Target Window field of PowerPro's "hotkey/mouse action" dialog with: ";<id=xxx>" -- including the semicolon & angle brackets, but not the double quotes -- or with .ini configuration files.
- LogKeys
- Description
- Sets keystroke logging to a file.
- Syntax
- Parameters
- fpath
- (string) either:
- full path to target file
- file name only
- The key logging file is then assumed to be in the same folder as the PowerPro configuration file.
- either of the above, preceded by "=" character
- toggles key logging on/off
- blank ("")
- Examples
- Exec.LogKeys(?"=c:\logs\keys.txt")
- Toggles key logging to the file "keys.txt".
- Exec.LogKeys("c:/logs/keys.txt")
Exec.ToFile("log", "Logging on: "++time)
; ...do stuff in here...
Exec.ToFile("log", "Logging off: "++time)
Exec.LogKeys("")
- Turns on keystroke logging to the file "c:\logs\keys.txt", then uses another Exec function, Exec.ToFile(), to add activity/time details to this file whilst keystroke logging is on.
- Note that in the Exec.ToFile() call, "log" is passed for the first parameter, the path to the open log file. The keyword "log" will only be recognised when keystroke logging is on.
- Notes
- Use the *Info buttons keyword "keylog" to display an X on a button label if logging is active.
- See Also
- PowerPro Help CHM > Built-in Commands > *Exec > Logging Keystrokes
- PPSR > Built-in Functions > by Category > Keys > keylog, keylogfile
- Monitor
- Description
- Suspend or re-activate repeated running of the special command list named "Monitor".
- Syntax
- Parameters
- keyword
- (string) action to take with running of Monitor list
- Optional, default is "on".
- Possible Values
- reverse
- toggles running of Monitor list
- on
- starts running Monitor list
- off
- stops running Monitor list
- Examples
- Exec.Monitor("on")
- Exec.Monitor("off")
- Exec.Monitor("reverse")
- Notes
- This function will only have an effect if PowerPro is configured to allow the special Monitor list (via the PPConfig > Command Lists > "Setup..." button > Special Lists dialog), & if a command list named "Monitor" exists.
- See Also
- PowerPro Help CHM > Configuring with the GUI dialogs > Command Lists > Bar and Menu "Setup" dialog > "Special Lists" tab
- MoreCommandsAsScript
- Description
- This function is only relevant in the PPConfig GUI.
- See Also
- PowerPro Help CHM > Built-in Commands > *Exec > *Exec commands
- Mute
- Description
- Toggles the current "Mute sounds" setting.
- Syntax
- Examples
- NewFolder
- Description
- Creates a new file folder.
- Syntax
- Parameters
- fpath
- (string) path to the new folder
- Optional, default is to show a PowerPro input prompt for the path.
- Possible Values
- a folder path
- creates a new file folder with specified path
- "" (empty)
- Shows a PowerPro input dialog that asks for a folder path, then creates a new file folder with specified path.
- Examples
- Exec.NewFolder
- Prompts for a folder path then creates a new folder as per the user input.
- Exec.NewFolder(?"f:\users\karen")
- Creates a new folder at "f:\users\karen".
- OnError
- Description
- Sets where PowerPro error messages go and whether HookErrors list is run.
- Syntax
- Parameters
- keywords
- (string) Single string comprising any combination of the keywords, separated with spaces.
- Possible Values
- none
- Do not display any error messages.
- file
- Write errors messages to file ErrorLog.txt only.
- must be in same folder as .pcf
- each error creates a line of space-separated info
- yyyymmdd
- hhmmss
- scriptname (or *)
- linenumber (or 0)
- messagetext
- newlines replaced with blanks
- display
- Display messages on screen only.
- both
- Write error to file and display on screen.
- hook
- Run command list HookErrors whenever an error occurs.
- unhook
- Do not run command list HookErrors.
- clear
- Set _LastError_ global variable to "".
- Alternative form of: _LastError_=""
- Examples
- Exec.OnError("none hook")
- Stops display of error messages & turns on the command list HookErrors to be run for each PowerPro error.
- Exec.OnError("file unhook clear")
- Sets PowerPro to write errors to the ErrorLog.txt file, turns off the HookErrors command list, & clears the global variable _LastError_.
- Exec.OnError("both")
- Tells PowerPro to write errors to file and display them on screen.
- Notes
- The global variable _LastError_ is set to the error message whenever any error occurs.
- If an error occurs while the HookErrors script is running, the script is not called again.
- Plugin
- Print
- Description
- Print a file using its associated program, such as Notepad for text files.
- Syntax
- Parameters
- fpath
- (string) full path to the target file
- Examples
- Exec.Print(?"c:\web\out.txt")
- Prompt
- Description
- Prompts for a Yes/No answer and sets a PowerPro flag according to the result.
- Syntax
- Parameters
- target
- either:
- (integer) number of the flag to set
- Prompt will have 2 buttons: Yes & No.
- (string) a variable name
- Prompt will have 3 buttons: Yes, No & Cancel.
- msg
- (string) text to appear in the prompt dialog
- UI Elements
- PowerPro messagebox
- button: Yes
- If pressed, target is set to 1
- button: No
- If pressed, target is set to 0
- button: Cancel
- If pressed, target is set to 2
- Cancel button only appears when target is a variable name string.
- Examples
- Exec.Prompt(14, "Do you like chocolate?")
Win.Debug(pproflag(14))
- Shows a message box asking "Do you like chocolate?", with 2 buttons, Yes & No, then sets flag 14 to the result.
- local ans
Exec.Prompt("ans", "Do you like chocolate?")
Win.Debug(ans)
- Shows a message box asking "Do you like chocolate?", with 3 buttons, Yes, No & Cancel, and sets variable ans to the result.
- QuoteEscape
- Description
- Sets whether single quote is an escape character in strings in expressions.
- Syntax
- Exec.QuoteEscape(keyword)
- Parameters
- keyword
- (string) action to take
- Possible Values
- Examples
- Notes
- Only works if Setup >Advanced >Characters "Escape character" is set to single quote.
- RefreshEnvironment
- Description
- Refreshes all environment variables from registry; does not delete variables which are deleted.
- Syntax
- Examples
- Notes
- Windows NT or later only.
- RestoreLastMin
- Description
- Restores the last minimized window.
- Syntax
- Examples
- SchedulerAdd
- Description
- Adds a new scheduled event.
- Syntax
- Exec.SchedulerAdd(evdate, evtime, action)
- Parameters
- evdate
- (integer) date of the event
- Possible Values
- yyyymmdd
- 0 < evdate < 1000
- number of days from now (zero for today)
- evtime
- (integer) time of the event
- Possible Values
- hhmm
- time in 24 hour clock time
- +hhmm
- number of hours and minutes from now
- action
- (string) either:
- a PowerPro command
- text, which will be set as a Win.Message() event.
- Examples
- Exec.SchedulerAdd(20061225, 0900, "Merry Christmas")
- Creates a new scheduled event to show a PowerPro message window with the message "Merry Christmas" at 9am on Christmas Day, 2006.
- Exec.SchedulerAdd(0, +100, "c:\program files\myprog\myprog.exe")
- Creates a new scheduled event to run myprog.exe one hour from now.
- Notes
- Exec.SchedulerAdd cannot be used in a script called from a scheduled alarm, unless you precede the Exec.SchedulerAdd() call by Wait.For(1000).
- The parameters evdate & evtime must each be a single number without colons, slashes, or other delimiters.
- Scroll
- Description
- Begins mouse-scrolling the window under the mouse, as if a middle-click had been pressed.
- Syntax
- Examples
- Notes
- To stop scrolling, left-click anywhere on the screen.
- This function is equivalent to Exec.ScrollWithMouse.
- See Also
- PowerPro Help CHM > Miscellaneous Usage Topics > Manual scrolling with the mouse
- ScrollWindow
- Description
- Scrolls the window under the mouse.
- Syntax
- Exec.ScrollWindow(numRows)
- Parameters
- numRows
- (integer) number of rolls to scroll
- Possible Values
- positive integer
- negative integer
- Examples
- Exec.ScrollWindow(5)
- Scrolls down 5 lines in the window under the mouse.
- Exec.ScrollWindow(-5)
- Scrolls up 5 lines in the window under the mouse.
- ScrollWithMouse
- Description
- Begins mouse-scrolling the window under the mouse, as if a middle-click had been pressed.
- Syntax
- Examples
- Notes
- To stop scrolling, left-click anywhere on the screen.
- This function is equivalent to Exec.Scroll.
- See Also
- PowerPro Help CHM > Miscellaneous Usage Topics > Manual scrolling with the mouse
- SetEnv
- Description
- Set environment variable to provided text. Use the env(...) function in expressions to read environment variables.
- Syntax
- Exec.SetEnv(varname, text)
- Parameters
- varname
- (string) name of the Windows Environment variable to set
- text
- (string) new value for varname
- Examples
- Exec.SetEnv("testEnvVar", "PowerPro is cool")
Win.Debug( env("testEnvVar") )
- Creates an environment variable "testEnvVar" & sets it to the string "PowerPro is cool", or resets the variable to that string if it already existed. The variable's value is then debugged.
- Notes
- If the Environment variable already exists, any previous value will be overwritten by this function.
- See Also
- PPSR > Built-in Functions > by Category > System > env
- StandardConfiguration
- Description
- Checks whether PPConfig > Setup >Advanced >"Use standard configuration" is checked & if not, outputs an error message & stops all scripts.
- Syntax
- Exec.StandardConfiguration
- Examples
- Exec.StandardConfiguration
- Tile
- Description
- Tiles the visible windows on the screen.
- Syntax
- Examples
- ToFile
- Description
- Writes a single line of text to a log file, including a line break at the end.
- Syntax
- Parameters
- fpath
- (string) path to the target file
- Possible Values
- a file path
- "log"
- The currently open log file, as specified by an Exec.LogKeys() call.
- text
- (string) the text to write to the file
- Examples
- Exec.ToFile(?"c:\web\out.txt", "some text to write")
- Exec.ToFile(?"c:\web\out.txt", date++":"++time)
- Notes
- Be aware that Exec.ToFile() will only write a single line of text -- and that means no line breaks within that string, either. (That will draw errors, too, if the string begins with a line break.)
- See Also
- Use the File plugin for file input and output with multi-lined strings. For more information, see:
- PPSR > Plugins > The Plugins > File
- the second example in Exec.LogKeys in this same section
- VolumeAll
- Description
- Set the volume for all types of playback.
- Syntax
- Parameters
- level
- (integer) sets the volume level
- Possible Values
- 0<level<255
- a value between 0 (mute) and 255 (loudest)
- +level
- increases the volume by the amount of level
- -level
- decreases the volume by the amount of level
- Examples
- Exec.VolumeAll(120)
- Sets the system volume to 120.
- Exec.VolumeAll(-120)
- Decreases the system volume by 120.
- VolumeWav
- Description
- Sets the volume for .wav files.
- Enter number 0 (mute) to 15 (loudest). Use + or - in front of number to adjust relative to current setting.
- Syntax
- Parameters
- level
- (integer) sets the volume level
- Possible Values
- 0<level<15
- a value between 0 (mute) and 15 (loudest)
- +level
- increases the volume by the amount of level
- -level
- decreases the volume by the amount of level
- Examples
- Exec.VolumeWav(10)
- Sets the volume for .wav files to 10.
- Exec.VolumeWav(-10)
- Decreases the volume of .wav files by 10.
- WindowInfo
- Description
- Displays/Hides a small PP window with information about the window under the mouse.
- Information includes the mouse screen position, plus the size, position, caption, class, and exe name of the window under the mouse.
- Syntax
- Information Displayed
- 1. mouse screen coordinates
- Absolute
- point (0,0) is top-left of screen
- Relative
- point (0,0) is top-left of window under mouse
- 2. window coordinates of window under mouse
- (left,top) - (right,bottom)
- 3. window size info
- main window size
- width x height of total window
- client window size
- width x height of window area excluding the border, caption, menu bar, tool bars, and status bar
- aspect ratio
- width of client window/height of client window
- 4. window caption
- 5. main window info
- handle in hex
- class
- exe name
- 6. child window info
- Examples
- Notes
- The Exec.Window commands acts as a toggle for the info window; to hide it, execute the command again.
- If the mouse cursor is over an Edit box, the contents of that box are shown as the caption. This can be useful to see password fields.
- Actions - QuickRef by Category
- File
- BrowseRun
- ClearRecent
- ClearRecentExplorer
- EmptyRecycleBin
- Explorer
- Exec.Explorer(folderpath)
- Explorer2
- Exec.Explorer2(folderpath)
- FindFiles
- FindComputer
- LogKeys
- NewFolder
- Print
- ToFile
- Window
- Autoscroll
- Exec.Autoscroll(scrollspeed)
- ContextMenu
- Exec.ContextMenu(path_or_obj)
- HideWindow
- RestoreLastMin
- Scroll
- ScrollWindow
- Exec.ScrollWindow(numRows)
- ScrollWithMouse
- Tile
- WindowInfo
- System
- CommandLine
- Exec.CommandLine(auto_complete_keywords)
- Dos
Exec.Dos
- RefreshEnvironment
- SetEnv
- Exec.SetEnv(varname, text)
- Multimedia
- PowerPro
- Alarms
- AutoPress
- CalcCalendar
- Calendar
- ChangeConfiguration
- Exec.ChangeConfiguration(pcfname)
- Disable
- HotKeys
- Exec.Hotkeys(keyword[, hotkeys][, id])
- Monitor
- MoreCommandsAsScript
- OnErrors
- Plugin
- Prompt
- QuoteEscape
- Exec.QuoteEscape(keyword)
- StandardConfiguration
- Exec.StandardConfiguration
- SchedulerAdd
- Exec.SchedulerAdd(evdate, evtime, action)
- File
- Overview
- The File command accesses PowerPro's internal file manipulation commands for manipulating files.
- Actions
- CommandRandom
- Description
- Runs a command with a randomly selected file as a parameter.
- Syntax
- File.CommandRandom(commandpath, filepath, args, hide)
- Parameters
- commandpath
- (string) path to the command file or program
- filepath
- (string) file path with wildcards
- args
- (mixed) arguments to use with the command
- Optional.
hide- (boolean)
- 1 or "hide"
- hides any output from the command
- 0 or "" (empty)
- shows any output from the command
- Optional, default is 0.
- Examples
- File.CommandRandom(?"c:\program files\bat\exec.bat", ;;+
?"c:\random\*.*", date, time, 1)
- Uses a file selected randomly from "c:\random\*.*" as the 1st parameter in the call to exec.bat, with the current date as the 2nd parameter & current time as the 3rd, running the command invisibly.
- File.CommandRandom(?"c:\utils\converter.exe", ;;+
?"c:\wallpapers\*.jpg", ?"c:\store\temppaper1.bmp")
- Passes a random .jpg file from "c:\wallpapers" to the converter.exe program, along with another parameter "c:\store\temppaper1.bmp", displaying any program windows on screen.
- See Also
- PowerPro Help CHM > Built-in Commands > *File > Working with a randomly selected file
- Copy
- Description
- Makes a copy of a file to the specified path.
- Syntax
- File.Copy(source, destination)
- Parameters
- source
- (string) full path to the file to be copied
- destination
- (string) path to the destination file
- If file name not included in path, source file name is used.
- Examples
- File.Copy(?"c:\mypath\in.txt", ?"c:\output\out.txt")
- Copies "c:\mypath\in.txt" to "c:\output\out.txt".
- File.Copy(?"c:\docs\*.txt", ?"c:\backup\")
- Use the "*" wildcard to that specify all text files in "c:\docs" are to be copied to "c:\backup".
- File.Copy(?"c:\mydocs\file?.txt", ?"c:\logs")
- Uses the "?" wildcard to specify that all text files with a file name consisting of the word "file" plus one more character & the extension should be copied to folder "c:\logs".
- CopyRandom
- Description
- Copies a randomly selected file to a specified file path.
- Syntax
- File.CopyRandom(filepath, outfile)
- Parameters
- filepath
- (string) path with wildcards
- outfile
- (string) destination for file copy
- Examples
- File.CopyRandom(?"c:\pictures\*.bmp", ?"c:\logo.sys")
- Copies a random .bmp file from the directory "c:\pictures" over the Windows startup screen file. (Windows 95/98/ME)
- See Also
- PowerPro Help CHM > Built-in Commands > *File > Working with a randomly selected file
- Delete
- Description
- Deletes a file, or group of files.
- Syntax
- Parameters
- filepath
- (string) path to the file to delete
- Use wildcards to define a group of files.
- Examples
- File.Delete(?"c:\temp\large.tmp")
- Deletes the file "large.tmp" in "c:\temp".
- File.Delete(?"c:\temp\*.tmp")
- Deletes all .tmp files in "c:\temp".
- File.Delete(?"c:\temp\*")
- Deletes all files in "c:\temp".
- DeleteNoRecycle
- Description
- Completely deletes a file or group of files, bypassing the recycle bin.
- Syntax
- File.DeleteNoRecycle(filepath)
- Parameters
- filepath
- (string) path to the file to delete
- Use wildcards to define a group of files.
- Examples
- File.DeleteNoRecycle(?"c:\temp\large.tmp")
- Deletes the file "large.tmp" in "c:\temp" without putting it in the recycle bin.
- File.DeleteNoRecycle(?"c:\temp\*.tmp")
- Deletes all .tmp files in "c:\temp" without putting them in the recycle bin.
- DeleteOld
- Description
- Deletes files in folder older than specified number of days
- Syntax
- File.DeleteOld(numdays, folderpath)
- Parameters
- numdays
- (integer) number of days file must be older than
- folderpath
- (string) path to the folder containing the files to delete
- Use wildcards to define a subset of files.
- Examples
- File.DeleteOld(5, ?"c:\temp")
- Deletes all files in "c:\temp" more than 5 days old.
- File.DeleteOld(5, ?"c:\temp\*.tmp")
- Deletes all .tmp files in "c:\temp" more than 2 days old.
- File.DeleteOld(3, "Recent")
- Deletes all files in the Recent folder that are older than 3 days.
- ExtChange
- Description
- Change, add, or remove a file extension.
- Syntax
- File.ExtChange(fpath, newext)
- Parameters
- fpath
- (string) path to the file to change
- Possible Values
- file character: |
- Used in file selection context menu commands to indicate the selected file.
- For more informaton, see: PPSR > Built-in Functions > by Category > File, Disk > "|"
- path expression
- newext
- (string) new extension for fpath
- Examples
- File.ExtChange("|", "txt")
- If this command was placed in the special command list Context, it could change the extension of the selected file in an Explorer-type window to ".txt".
- Move
- Description
- Moves a file or files to another location, effectively renaming it to the new path.
- Syntax
- File.Move(source, destination)
- Parameters
- source
- (string) full path to the file to be moved
- Use wildcards to move groups of files.
- destination
- (string) path to the new file location
- If destination does not included a file name, source file name is used.
- Examples
- File.Move(?"c:\mypath\in.txt", ?"c:\output\out.txt")
- Moves "c:\mypath\in.txt" to "c:\output\out.txt".
- File.Move(?"c:\docs\*.txt", ?"c:\backup\")
- Use the "*" wildcard to that specify all text files in "c:\docs" are to be moved to "c:\backup".
- File.Move(?"c:\mydocs\file?.txt", ?"c:\logs")
- Uses the "?" wildcard to specify that all text files with a file name "file" plus one character & extension .txt should be moved to folder "c:\logs".
- Notes
- This function is the same as File.Rename().
- Rename
- Description
- Renames a file or files, effectively moving it to the new path.
- Syntax
- File.Rename(source, destination)
- Parameters
- source
- (string) full path to the file/s to be renamed
- Use wildcards to rename groups of files.
- destination
- (string) path to the new file/s location
- If destination does not included a file name, the source file's name is used.
- Examples
- File.Rename(?"c:\mypath\in.txt", ?"c:\output\out.txt")
- Renames "c:\mypath\in.txt" to "c:\output\out.txt".
- File.Rename(?"c:\docs\*.txt", ?"c:\backup\")
- Use the "*" wildcard to that specify all text files in "c:\docs" are to be renamed (i.e. moved) to folder "c:\backup".
- File.Rename(?"c:\mydocs\file?.txt", ?"c:\logs")
- Uses the "?" wildcard to specify that all text files with a file name "file" plus one character & the extension .txt, should be moved to folder "c:\logs".
- Notes
- This function is the same as File.Move().
- RunRandom
- Description
- Selects a file at random from a folder & runs it using the program associated with the file extension.
- Syntax
- Parameters
- fpath
- (string) path with wildcards
- Examples
- File.RunRandom(?"c:\sounds\*.wav")
- Plays a random .wav file from "c:\sounds".
- See Also
- PowerPro Help CHM > Built-in Commands > *File > Working with a randomly selected file
- See Also
- Exec.ToFile() for writing to a file
- PPSR > Built-in Commands > Exec > ToFile
- The File plugin:
- PPSR > Plugins > The Plugins > File
- Format
- Overview
- Format commands are used for formatting bars & menus.
- Many of these will only work in particular situations, as specified.
- Actions
- BarVerticalLine
- Description
- Draws a vertical line on a bar.
- Syntax
- Examples
- Context
- Description
- Starts a menu/bar section , or shows a whole bar, depending on the active window.
- Syntax
- Parameters
- expr
- (mixed) caption list specifying the context for the bar/menu to be displayed
- Examples
- *Format Context =metapad
- Used as the first command of a bar, this would make the bar be displayed only when a Metapad window is the activewindow. A closing *Format EndContext command is not required in this situation.
- Used within another menu/bar, this would start a contextual section that is only shown when Metapad is active. In this case, it must be followed by a *Format EndContext command.
- ContextIf
- Description
- Starts a menu/bar section , or shows a whole bar, depending on the active window, where the context is given by an expression.
- Syntax
- Parameters
- expr
- (mixed) caption list expression that must be evaluated to true for the bar/menu to be displayed
- Examples
- *Format ContextIf (modem or a>0)
- Used as the first command of a bar, this would make the bar be displayed only when the dialup modem is connected, or variable a is greater than 0. A closing *Format EndContext command is not required in this situation.
- Used within another menu/bar, this would start a contextual section that is only shown when the dialup modem is connected, or variable a is greater than 0. In this case, it must be followed by a *Format EndContext command.
- Drag
- Description
- Gives click-drag functionality to any bar button assigned this command, whereby click-dragging that button will move the bar.
- Syntax
- Examples
- EndContext
- Description
- Ends a section started with a *Format Context or *Format ContextIf command.
- Syntax
- Examples
- EndSubMenu
- Description
- Ends a submenu in a menu.
- Syntax
- Examples
- Notes
- A menu is started with a *Format StartSubMenu command.
- Menus may be nested.
- Item
- Description
- Obsolete.
- Use CL functions instead, see:
- MaxColumn
- Description
- Sets the maximum number of entries per column in a menu.
- Syntax
- Parameters
- n
- (number) maximum number of entries per column
- Examples
- *Format MaxColumn 20
- Sets the maximum number of menu items per column to 20.
- Notes
- May not be effective with embedded submenus, in which case use explicit *Format NewColumn commands.
- NewBarRow
- Description
- Starts a new row in a bar.
- Syntax
- Examples
- NewBarRowLine
- Description
- Starts a new row in a bar & draws a separator line.
- Syntax
- Examples
- NewColumn
- Description
- Starts a new column in a menu.
- Syntax
- Examples
- NewColumnLine
- Description
- Starts a new column with a vertical separator line.
- Syntax
- Examples
- Separator
- Description
- Draws a vertical separator on a bar or menu.
- Syntax
- Examples
- StartSubMenu
- Description
- Starts a submenu in a menu.
- Syntax
- Examples
- Notes
- To specify the label for a submenu when using a Format StartSubMenu command in a script or text file, put the label in front of the command, with a preceding "@" symbol:
- @MyMenu Format StartSubMenu
- Starts a submenu which will be labelled "MyMenu".
- Must be closed with *Format EndSubMenu
- Keys
- Overview
- The old format *Keys command becomes Win.SendKeys() with PowerPro's new expression syntax, & there is also the equivalent command Win.Keys(), which uses a different behind-the-scenes method to send the keys.
- This Keys section of PPSR provides a reference for the target window & keyboard key codes used with both Keys functions.
- General Syntax
- Win.Keys("{target_window_string}keys_to_send")
- Win.SendKeys("{target_window_string}keys_to_send")
- Parameters
- target_window_string
- (string) keyword or caption list string indicating which window is to receive the keys, surrounded by curly braces
- Optional, defaults to the active window.
- In the list of Possible Values below, each "to" may be replaced by "toany":
- to
- works with visible windows only
- leaves the focus at the window receiving the keys
- toany
- works with both hidden and visible windows
- returns the focus to the window which had it before keys were sent
- Possible Values
- {to *}
- Sends keys to the currently active window.
- Example
- Win.Keys("{to *}%{f4}")
- Sends alt-f4 to the current window, closing it.
- {to activebar}
- Sends the keys to the last window referenced by a button on an active windows bar.
- Example
- Win.Keys("{to activebar}quick brown fox")
- Sends "quick brown fox" to the last window selected via a click on an active windows bar.
- {to autorun}
- Sends the keys to the last window matched by an autorun-type command list.
- Example
- Win.Keys("{to autorun}%{sp}n")
- Sends alt-f4 to the current window, closing it.
- {to captionlist}
- Sends the keys to the first window matching the captionlist.
- For full list of accepted window id types, see:
- PPSR > Language Reference > Caption Lists
- PPSR > Language Reference > Window ID's
- Examples
- Win.Keys("{to *Firefox}^l")
- Sends Ctrl-L to Firefox to go to the location bar.
- Win.Keys("{to c=metapad}quick brown fox")
- Sends "quick brown fox" to the first window of class "metapad" found.
- Win.Keys("{to =firefox}"++myusername++"{ta}{w3}"++mypassword++"{en}")
- Sends a username & password to Firefox.
- {to =fpath}
- Sends keys to program run from the file path, fpath.
- File path must be prepended with equals sign.
- Example
- Win.Keys("{to =c:\pgms\pgm.exe}something to be sent")
- Sends "something to be sent" to pgm.exe.
- {to none}
- Does not check if a window is available, instead makes keys available in keyboard buffer only.
- Example
- Win.Keys("{to none}"++date)
- Puts the current date on the kb buffer.
- {to folder}fpath
- Used with File Open/Save As dialogs.
- Changes the current directory of a File Open/Save As dialog to the specified folder path, fpath.
- Example
- Win.Keys(?"{to folder}c:\program files")
- Changes the current directory of a file open/save dialog to:
"c:\program files".
- Assign this command to a button on a bar of similar buttons with folder shortcuts, in order to create a quick-jump bar to be shown whenever a File Open/Save As dialog is shown.
- Notes
- The process PowerPro takes to perform this action is:
- select the File Name field
- save anything currently in it
- send the folder path to the dialog
- restore the File Name field's contents
- Generates a PowerPro error if used on anything other than a File Open or Save dialog.
- Any text after fpath will be considered part of the folder path (and thus may cause errors).
- {filemenu filepath}
- Shows a menu created from the contents of a file, & the selected option is sent as keys to the active document.
- filepath=full path to the file containing the menu to be shown
- Example
- Win.Keys(?"{filemenu c:\path\to\menu.txt}")
- Shows the contents of "menu.txt" as a menu, & sends the selection to the active document
- Notes
*Format commands can be used with menu text files, but require an @label at the start of the line (for some reason..?)
- See Also
- More information on file menus:
- PowerPro Help CHM > Built-in Commands > *Menu > File menus
- {from c:\path\filename.txt}
- Sends the contents of the specified text file to the active document.
- Example
- Win.Keys(?"{from c:\mydocs\signature.txt}")
- Notes
- The text file can contain both standard standard ascii characters & PowerPro key codes, enabling functionality such as text formatting, program shortcuts & menu actions.
- Text file must be in DOS or Windows format (not Unicode).
- Any text after the closing brace will cause errors.
- Window Prefixes::UL
- An optional single character prepended to the target portion of the target window string, with special meaning as outlined below:
- Possible Values
- ^
- +
- waits up to 3 secs for for the specified window to be ready
- -
- PowerPro sleeps a short time before sending the keys
- Examples
- Win.Keys("{to +*metapad}quick brown fox")
- Waits up to 3 seconds for the first Metapad window found to be ready for input, then sends the keys "quick brown fox" to it.
- Win.Keys("{to ^=firefox}^l{w1}miinx.com.au{en}")
- Sends the F6 key to the first Firefox window found to select the location bar, hiding any error message if the window is not found, then waits 1/10th of a second before sending the url "miinx.com.au" & the Enter key.
- keys_to_send
- (string) any combination of alphanumeric characters & special keycodes making up the keys to be sent to the target window
- Keycodes::UL
- See:
- PPSR > Appendix > Win.Keys() & Win.SendKeys() Key Codes
- Notes
Win.Keys() allows up to 1000 characters.- my testing doesn't show this... maybe 1000 bytes?
- See Also
- PPSR > Plugins > The Plugins > Win > Commands > by Category > Keys > Keys
- PPSR > Plugins > The Plugins > Win > Commands > by Category > Keys > SendKeys
- Macro
- Overview
- Keyboard macros let you create predefined text shortcuts that, when typed, are replace by the full text.
- Notes
- There are no functions related to the Macro command.
- The *Macro command can only be used with hot keys, and therefore does not appear in the PProConfig GUI command drop-down list. Using *Macro in any other context will generate an error message.
- See Also
- For more information on creating & using PowerPro macros, see:
- PowerPro Help CHM > Built-in Commands > *Macro > *Macro command
- Menu
- Overview
- The Menu command is used to display a menu.
- Actions
- Explorer
- Description
- Shows a menu of folders recently accessed with Explorer.
- Syntax
- Examples
- Notes
- "Track Explorer" on the Setup dialog must be checked, or PowerPro will return an error.
- Folder
- Description
- Shows a menu of files from a folder.
- Syntax
- Menu.Folder(folderPath, sFormat)
- Parameters
- folderPath
- (string) path to the base folder
- Optional, defaults to the logged in user's "Start Menu" directory.
- Possible Values::UL
- full path to a folder
- the name of any folder in the currently logged in user's profile folder, such as:
- Application Data
- Cookies
- Desktop
- Favorites
- Local Settings
- My Documents
- NetHood
- PrintHood
- Recent
- SendTo
- Start Menu
- Templates
- any of the following Keywords:
- AllPrograms
- Menu of Start Menu Programs folders for All Users profile.
- Allprograms FFF
- Menu of Start Menu Programs folder FFF for All Users profile.
- NT4 only.
- AllStartMenu
- Start menu for All Users profile
- NT4 only.
- AllDesktop
- Desktop for All Users profile.
- NT4 only.
- personal
- Shortcut for current user's Favorites folder
- programs
- Programs folder from Start Menu for current user.
- NT4 only.
- programs FFF
- menu of Programs folder FFF (e.g. Accessories)
- NT4 only.
- sFormat
- (string) any combination of the following keywords indicating desired menu format
- Optional.
- Keywords
- *all
- Execute all commands/programs in folderPath, rather than displaying a menu.
- *allclose
- Close all commands/programs in folderPath, rather than displaying a menu.
- *allcloseforce
- Force closed all commands/programs in folderPath, rather than displaying a menu.
- autocol n
- Automatically starts a new column every n+1 entries.
- Applies to top level menu only.
- autocolall n
- Automatically starts a new column every n+1 entries.
- Applies to top level menu & submenus.
- autosoftcol n
- Automatically starts a new column every n+1 entries, without including a bar between the columns.
- Applies to top level menu only.
- autosoftcolall n
- Automatically starts a new column every n+1 entries, without including a bar between the columns.
- Applies to top level menu and submenus.
- back
- Bar or menu takes the default background defined in PPCD > Command Lists > Setup.
- center
- cmd 'cmdline' 'params'
- Defines a command line & parameters to be executed with the selected file, where:
- 'cmdline'
- command to be executed, in single quotes
- 'params'
- parameters for 'cmdline', in single quotes
- Use the _file_ variable or a "|" to indicate where the selected file is to be placed in the command line.
- The command line & parameter strings that appear after the "cmd" keyword can optionally be enclosed in nested single quotes, unless the strings contain spaces, in which case single quotes must be used.
- Example
- Menu.Folder("desktop", "cmd 'c:\program files\2x\2xExplorer' '|*'")
- empty
- Empty folders will be included in the menu (normally, they are excluded).
- exclude \"folders_list\"
- Excludes all folders listed in folders_list, a comma-separated list of folders.
- Examples
- Menu.Folder(?"c:\temp", "exclude \"c:\\temp\\store, c:\\temp\\logs\"")
- Shows a menu of the "c:\temp" directory, excluding the "store" and "logs" folders.
- Menu.Folder(?"c:\temp", ?#exclude "c:\temp\store, c:\temp\logs"#)
- Shows a menu of the "c:\temp" directory, excluding the "store" and "logs" folders.
- Doesn't work with other exclusion-type keywords:
- nofiles
- nofolders
- nosubdir
- nosubmenu
- explorer
- Adds a menu entry with label "Explore" at the top of all submenus, a shortcut to open a single-paned Explorer window.
- The entry can be:
- left-clicked
- to open a single-paned Explorer window on the selected directory
- right-clicked
- to show a Menu.Folder() menu for that folder, useful if files are not being displayed in the current menu.
Am getting an error when right-clicking explorer entry:
Cannot access context menu for:
c:\docs & settings\username\start menu\programs\
Error occurred near line 1 which contained:
Menu.Folder("programs", "explorer fileman \"open in explorer\" ")
- explorer2
- Adds a menu entry with label "Explore" at the top of all submenus, a shortcut to open a double-paned Explorer window.
- The entry can be:
- left-clicked
- to open a double-paned Explorer window at the selected directory
- right-clicked
- to show a Menu.Folder() menu for that folder, useful if files are not being displayed in the current menu.
- fileman \"lbl\"
- Where lbl = label for the optional top item of submenus, created when the "explorer" keyword is included.
- The "explorer" keyword must also be included in sFormat whenever "fileman" is used.
- Example
- Menu.Folder("programs", "explorer fileman \"Open in Explorer...\" ")
- folderback
- Adds a "Back" entry to the top of the menu, to go back to previous folder.
- Only useful when NoSubDir is specified.
- folderdots
- Adds "..." to folder names.
- Useful to highlight folders when NoSubDir is specified & icons are not used in menus.
- foldershorcut
- Expands all folder shortcuts in the menu.
- foldershorcuts2
- Expands foldershortcuts with names ending in "_x".
- folderstart
- Sorts menu entries so that folders are at the start.
- noicons
- Omits menu icons.
- Only works if the Menu.Folder() command is not embedded in another menu.
- maxtext n
- Limits text labels to n characters.
- mne
- Powerpro assigns single character menu mnemonics to the first 36 items on the main menu, allowing them to be easily selected with the keyboard.
- noext
- File extensions are removed from menu item labels.
- nofiles
- Files are not displayed, only folders.
- Useful with the "explorer" option to traverse large folder trees quickly.
- nofolders
- nosort
- Menu items will not be sorted.
- nosubdir
- Dynamic subdirectories (that appear when the parent items are moused over) are not included.
- The names of subdirectories are still shown, & if selected, a Menu.Folder() is shown for that subdirectory.
- Doesn't work with "exclude" keyword.
- nosubmenu
- All files from all subdirectories will be listed in the main menu.
- No folders are shown.
- offset n1 n2
- Positions the menu offset n1 characters to the right, & n2 characters below the mouse cursor.
- n1 & n2 can be negative.
- omit
- Deletes the phrases in the "Omit strings..." edit box on the PProConf > Command Lists > Setup > All Bars and Menus > Config tab.
- "omit" is applied before "maxtext n", if both are specified.
- sortext
- Menu items are sort by file extension.
- sorttime
- Sorts most recently change files to the start of the menu.
- tipall
- Shows up to 6 lines of the file contents in the tool tip.
- Some file types (text-based, such as .txt, .html, .ini) work better than others (such as .exe) with this keyword.
- tiptext
- Shows up to 6 lines of .txt file contents on tool tip.
- tool tips
- Shows tool tips, regardless of PProConf setting on Tool Tip Setup dialog.
- under
- Centers the menu under the mouse.
- Zero \"vars_list\"
- vars_list = space-separated list of variables to be set to 0 before the files are processed.
- Keywords - QuickRef by Category
- Execution
- *all
- *allclose
- *allcloseforce
- cmd 'cmdline' 'params'
- Explorer
- explorer
- explorer2
- fileman \"lbl\"
- Menu Position
- center
- embed
- offset n1 n2
- under
- Subfolders & File Inclusion
- empty
- exclude \"folders_list\"
- folderback
- folderdots
- foldershorcut
- foldershorcuts2
- folderstart
- n
- nofolders
- nosubdir
- nosubmenu
- File Extensions
- Files can be included &/or excluded by listing them, with a "-" char in front of those to be excluded.
- Menu Formatting
- autocol n
- autocolall n
- autosoftcol n
- autosoftcolall n
- nofiles
- noicons
- nosort
- sortext
- sorttime
- Text Labels
- back
- maxtext n
- mne
- noext
- omit
- Tool Tips
- Initialise Variables
- Examples
- Menu.Folder("c:/jane/docs")
- Creates a menu of files from folder "c:\jane\docs".
- Menu.Folder("c:/jane/docs", "nofolders")
- Menu.Folder("programs", "explorer fileman \"open in explorer\" ")
- Menu.Folder(?"c:\my pics", "folderback folderdots folderstart nosubdir center tipall")
- Notes
- Use wildcard matches to limit the files shown.
- See Also
- PowerPro Help CHM > Built-in Commands > *Menu > *Menu Folder
- PowerPro Help CHM > Built-in Commands > *Menu > *Menu Folder formatting
- PowerPro Help CHM > Built-in Commands > *Menu > Special folders for *Menu Folder
- PowerPro Help CHM > Built-in Commands > *Menu > Entering format information for *Menu Folder Command
- Recent
- Description
- Shows a menu of recently executed windows (and/or commands), & the selected item is re-executed.
- Syntax
- Notes
- "Track windows for *Menu RecentCommands" in "PProConf > Command Lists > Setup > All Menus" must be checked.
- Windows shown in the list are the ones most recently executed by any means, not just via PowerPro.
- Examples
- StartMenu
- Description
- Shows the Windows start menu at the mouse cursor.
- Syntax
- Examples
- Notes
- Windows will initially show the menu in the standard location at lower left of screen, before the menu will appear to jump to the cursor. This repositioning of the menu is unavoidable at present.
- See Also
- PPSR > Built-in Commands > *Menu > Folder
- Show
- Description
- Shows a command list as a menu, positioned according to specified keyword.
- Syntax
- Menu.Show(clname, position)
- Parameters
- clname
- (string) name of the command list to use for the menu
- position
- (string) one of the following position keywords:
- Possible Values
- centerUnderMouse
- Centers the menu under the mouse.
- centerScreen
- Centers the menu on the screen.
- offset n1 n2
- Shows the menu positioned n1 pixels to the left & n2 pixels above the mouse.
- n1 & n2 can be negative, which would position the menu to the right & below the cursor respectively.
- Note
- If the config setting "Force cursor over new opened menus" (in PProConf > Command Lists > Setup > All Menus) is checked, this setting will not have any effect.
- screen n1 n2
- Shows the menu at screen position (n1, n2), where:
- n1 = pixels from left
- n2 = pixels from top
- horButton
- Shows the menu aligned under/above the last button pressed on a horizontal bar.
- horButtonCenter
- Shows the menu centered under/above the last button pressed on a horizontal bar.
- verButton
- Shows the menu aligned left/right of the last button pressed on a horizontal bar.
- Examples
- Menu.Show("Locations", "offset 20 20")
- Shows the command list named "Locations", positioned 20px above & 20px to the left of the mouse.
- Menu.Show("Locations", "centerScreen")
- Shows the command list named "Locations", positioned in the centre of the screen.
- Notes
- Use the Format command to add submenus and separators to a menu.
- The position keywords "horbutton" and "verbutton" perform the same alignment as a Menu.ShowAtButton() command, however, by using Menu.Show(), you can more precisely specify the menu's bar alignment.
- See Also
- PowerPro Help CHM > Built-in Commands > *Menu > Showing menus
- ShowAtButton
- Description
- Meant for use on bar buttons, this command shows a menu aligned with the button used to display it.
- Syntax
- Menu.ShowAtButton(clname)
- Parameters
- clname
- (string) name of the command list to use for the menu
- Examples
- Menu.ShowAtButton("Locations")
- This command could be used with a button labelled "Locations", which would open the Locations command list as a menu aligned with this button.
- Notes
- For horizontal bars, the menu is shown below or above the button, depending on which half of the screen the bar is in.
- For vertical bars, the menu is shown to the left or right of the button, depending on which half of the screen the bar is in.
- See Also
- Menu.Show()
- PPSR > Built-in Commands > Menu > Show
- ShowAtCursor
- Description
- Shows a command list as a menu at a text cursor, if present.
- Syntax
- Menu.ShowAtCursor(clname)
- Parameters
- clname
- (string) name of the command list to use for the menu
- Examples
- Menu.ShowAtCursor("Snippets")
- Shows the command list "Snippets" as a menu aligned with the current document's text prompt.
- Notes
not working..?
- See Also
- Menu.Show()
- PPSR > Built-in Commands > Menu > Show
- ShowFile
- Description
- Shows the contents of a file as a menu.
- Syntax
- Parameters
- fpath
- (string) path to the file containing the menu
- Examples
- Menu.ShowFile(?"c:\mine\stuff.txt")
- Shows the file "stuff.txt" as a menu.
- Notes
- Use *Format commands in the file to format the menu, create submenus, add separators & conditionally include items.
- The following Properties Keywords may be used within the menu file for formatting:
- back *
- Sets menu background to use desktop wallpaper.
- back "fpath"
- fpath = path (in quotes) to .bmp for menu background
- back r g b
- r g b = red green blue components of menu background colour
- Each value is between 0 & 255.
- fontbold
- fontitalics
- Sets menu font to italics.
- fontname fn
- fn = font name
- Use double quotes if fn contains spaces.
- Must be specified for other font keywords to be actioned.
- fontsize n
- fontwidth n
- n = boldness of font, as a number
- 0 < n < 255
- iconsize
- Makes icons included & sets icon size.
- Must be specified for icons to be shown.
- maxtext n
- n = maximum length of menu labels
- 0 < n < 255
- text r g b
- r g b = red, green, blue components of text colour
- Each value is between 0 & 255.
- tooltips
- Shows tool tips for menu items.
- See Also
- Alternative command:
- PPSR > Built-in Functions > by Category > Files > filemenu()
- More information on formatting file menus:
- PowerPro Help CHM > Built-in Commands > *Menu > File menus
- PowerPro Help CHM > Built-in Commands > *Menu > Properties in file menus
- The {filemenu fpath} argument in Win.Keys():
- PPSR > Plugins > The Plugins > Win > Keys
- Tray
- Description
- Shows a menu of all current tray icons.
- Syntax
- Examples
- See Also
- PowerPro Help CHM > Built-in Commands > *TrayIcon > Show Tray Icons in Active Bar or Menu
- UnderMouse
- Description
- Show the menu of the window under the mouse.
- Windows 95/98 only.
- Syntax
- Examples
- Notes
- Must be assigned to a hot key or as part of menu shown by hot key.
- Only shows standard menus, not toolbars like the menu tool bar in Explorer.
- Message
- Overview
- The old format *Message command is replaced by the built-in function messagebox() in the new expression syntax.
- See Also
- For more information on the messagebox() function, see:
- PPSR > Built-in Functions > by Category > Dialogs > messagebox
- Mouse
- Overview
- The old format *Mouse command becomes Win.Mouse() with PowerPro's new expression syntax.
- Syntax
- Parameters
- mouse_codes
- (string) any combination of long-format or short-format codes, as a quote-delimited string
- Possible Values::ULP
- Modifier Keys
- Alt
- Reverses the Alt key (presses it if it's up, releases it if down).
- short form:
- Ctrl
- Reverses the Control key (presses it if it's up, releases it if down).
- short form:
- Shift
- Reverses the Shift key (presses it if it's up, releases it if down).
- short form:
- Win
- Reverses the Windows key (presses it if it's up, releases it if down).
- short form:
- Mouse Buttons
- LeftClick
- left click (both left down and left up)
- short form:
- LeftDown
- LeftUp
- LeftDouble
- double left click
- short form:
- Note: "lc lc" will not work.
- MiddleClick
- middle click (both middle down and middle up)
- short form:
- MiddleDown
- MiddleUp
- MiddleDouble
- double middle click
- short form:
- Note: "mc mc" will not work.
- RightClick
- right click (both right down and right up)
- short form:
- RightDown
- RightUp
- RightDouble
- double right click
- short form:
- Note: "rc rc" will not work.
- Mouse Position
- Move x y
- Moves the mouse x pixels right, & y pixels down.
- x & y can be negative.
- short form:
- Save
- Saves the current mouse position.
- short form:
- Screen x y
- Moves the mouse to a position (x,y) on the screen, where (0,0) is top left.
- short form:
- Relative x y
- Moves the mouse to a position x pixels to the right & y pixels below the top-left corner of the active window.
- short form:
- Restore
- Restores a saved mouse position.
- If there is no saved position, the mouse is moved to screen (0,0).
- This mouse code has no short form.
- Examples
- Win.Mouse("relative 50 100 leftclick")
- Moves the mouse to the position (50,100) relative to the active window, then left-clicks.
- This could also be written:
Win.Mouse("re 50 100 lc")
- Win.Mouse("sa mo 100 40 lc restore")
- Saves the current mouse position, then moves the mouse 100px right & 40px down before left-clicking, then restores the original mouse position.
- Win.Mouse("ct lc ct")
- Sends a Ctrl-Left-click to the active window.
- See Also
- PPSR > Plugins > The Plugins > Win > Services - Alpha-order [M-Z] > Mouse
- Note
- Overview
- The Note command lets you work with PowerPro notes.
- Actions
- CloseCategory
- Description
- Closes all notes open from specified category.
- Syntax
- Parameters
- cat
- (string) note category
- Possible Values
- Examples
- Note.CloseCategory("work")
- Closes all notes in category "work".
- DeleteOpenCategory
- Description
- Deletes notes opened from specified category.
- Syntax
- Note.DeleteOpenCategory(cat)
- Parameters
- cat
- (string) note category
- Possible Values
- Examples
- Note.DeleteOpenCategory("clipstore")
- Deletes all notes from category "clipstore" that are open.
- Open
- Description
- Creates a new note or opens an existing note (or notes) & returns the note's handle.
- Syntax
- Note.Open(fpath, cat_expr)
- Parameters
- fpath
- (string) full path to a note, including .ppronote extension
- Optional, if omitted, a new note is created.
- If specified, the note must already exist.
- cat_expr
- (string) category string, in format "cat catname" where catname=category name
- Optional, but it must be the 2nd parameter, & the 1st parameter must be an empty string (otherwise the 2nd parameter is ignored).
- Return Value
- (integer) the note's handle
- Examples
- Note.Open
- global nh = Note.Open
- Opens a new note & assigns its handle to the global variable nh.
- Note.Open(pprofolder++?"notes\dev\stuff.ppronote")
- Opens the note "stuff.ppronote".
- Note.Open("", "cat work")
- Opens a new note in category "work".
- Note.Open("","cat "++date)
- Opens a new note with its category set to today's date.
- OpenCategory
- Description
- Opens all notes in specified category.
- Syntax
- Parameters
- cat
- (string) note category
- Possible Values
- Examples
- Note.OpenCategory("work")
- Opens all notes in category "work".
- OpenMenu
- Description
- Shows a menu of all open notes, & brings the selected note to the top.
- Syntax
- Examples
- OpenOneFromMenu
- Description
- Shows a menu of notes from specified category & opens the selected note.
- Syntax
- Note.OpenOneFromMenu(cat)
- Parameters
- cat
- (string) note category
- Possible Values
- Examples
- Note.OpenOneFromMenu("lists")
- Shows a menu of all notes in category "lists", then opens the chosen note.
- OpenToday
- Description
- Shows notes with date categories today or before
- Syntax
- Examples
- Notes
not working..? does nothing.
- ShowHideOpen
- Description
- Toggles hidden/shown state of open notes.
- Syntax
- Parameters
- cat
- (string) note category
- Possible Values
- Examples
- Note.ShowHideOpen("*")
- Toggles visibility of all open notes.
- Note.ShowHideOpen("work")
- Toggles visibility of all notes open from category "work".
- ShowOpen
- Description
- Shows all hidden notes from a category.
- Syntax
- Parameters
- cat
- (string) note category
- Possible Values
- Examples
- Note.ShowOpen("work")
- Shows all notes in category "work" that are open but hidden.
- See Also
- PowerPro Help CHM > Built-in Commands > *Note > *Note command
- PPSR > Plugins > The Plugins > Note
- ScreenSaver
- Overview
- The ScreenSaver command is used to work with the Windows screen saver.
- Actions
- Change
- Description
- Changes to a random screen saver file (.scr file) in same folder.
- Syntax
- ScreenSaver.Change(folder_path)
- Parameters
- folder_path
- (string) full path to folder containing screen saver files
- If a filename is included in the path, it is ignored.
- Optional.
If omitted, PowerPro appears to search the whole hard drive..?
- Examples
- ScreenSaver.Change(?"c:\pics\savers")
ScreenSaver.Start
- Changes to a new screensaver from the folder "c:\pix\savers", then starts it.
- Notes
- PowerPro Help CHM says ScreenSaver.Change() picks files either at random or sequentially, but I am unable to get sequential savers (assuming that sequentially as in alphabetically).
- ChangeRestart
- Description
- Sets, clears, or reverses the "Restart running saver if changed" setting in PowerPro Config > GUI Control dialog.
- Syntax
- ScreenSaver.ChangeRestart(state)
- Parameters
- state
- (string) action to take with setting
- Possible Values
- clear
- set
- checks the setting's checkbox
- reverse
- toggles the current setting state
- Examples
- ScreenSaver.ChangeRestart("set")
- Ticks the checkbox next to the setting "Restart running saver if changed" in PProConf.
- ScreenSaver.ChangeRestart("reverse")
- Reverses the setting "Restart running saver if changed" in PProConf.
- ChangeTimeout
- Description
- Changes saver timeout (time before saver kicks in) to the specied value.
- Syntax
- ScreenSaver.ChangeTimeout(mins)
- Parameters
- mins
- (integer) new timeout value in minutes
- Examples
- ScreenSaver.ChangeTimeout(10)
- ChangeTo
- Description
- Changes screen saver to file specified.
- Syntax
- ScreenSaver.ChangeTo(fpath)
- Parameters
- fpath
- (string) full path to the screensaver file
- Examples
- ScreenSaver.ChangeTo(?"c:\windows\system32\sspipes.scr")
- Changes screen saver to "sspipes.scr".
- Notes
not working..?
- Disable
- Description
- Disables the screen saver.
- Syntax
- Examples
- Enable
- Description
- Enables the screen saver.
- Syntax
- Examples
- Start
- Description
- Syntax
- Examples
- Stop
- Description
- Syntax
- Examples
- TempDisable
- Description
- Disables the saver until the mouse is moved.
- Syntax
- Examples
- Notes
- The TempDisable command is normally used with a screen corner hotkey. Moving the mouse to the hotkey screen corner which activates the command will disable the saver until the mouse is moved again.
- Notes
- If the current screensaver is set to "none" or "blank" via the Contol Panel > Display Properties > Screen Saver dialog, PowerPro ScreenSaver commands will not work, & the screensaver "scrnsave.scr" in Windows' system32 directory is used.
Script- Overview
- The old format Script command encompassed a range of functions relating to control & manipulation of PowerPro scripts.
- Most of these commands are now deprecated for scripting use, and the rest are all mentioned in other places of this reference.
- General Syntax for Script commands
- *Script [command] [parameters]
- Script commands use the old Literal syntax.
- Commands
- assign
- Obsolete. Instead, use:
- myvar = expression
- myvar=expression
- break
- close
- closeforce
- debug
- else
- elseif
- endif
- endfor
- flag
- Description
- PP has 32 flags, numbered 0-31
- Flags can only have a value of 0 or 1
- Syntax
- Parameters
- action
- (unquoted string) whether to set, clear, or reverse the flags n1 to n2 inclusive
- Possible Values
- n1
- (number) zero-based index of first flag in target series
- n2
- (number) zero-based index of last flag (inclusive) in target series
- Examples
- Flag set 4 7
- Sets flags 4, 5, 6, and 7.
- Flag clear 0 31
- See Also
- The built-in function, pproflag(), which can be used to test a flag.
- PPSR > Built-in Functions > by Category > PowerPro > pproflag
- for
- global
- if (expr)
- if (expr) do
- jump
- Obsolete. Instead, use the dot syntax:
- local
- quit
- quit all
- quit (exp)
- path
- run
- runfile
- setstring
- static
- Shutdown
- Overview
- The Shutdown command has functions to shutdown/exit both PowerPro and Windows.
- Actions
- Dialog
- Description
- Shows the standard "Shut Down Windows" exit dialog.
- Syntax
- Examples
- Hibernate
- Description
- Puts the computer into hibernate power mode.
- Syntax
- Examples
- LockWorkStation
- Description
- Sign off user and lock workstation.
- Syntax
- Examples
- Logoff
- Description
- Logs the current Windows user off.
- Syntax
- Examples
- PowerPro
- Description
- Syntax
- Examples
- Notes
- If a command list named "PProShutdown" exists, it is run.
- Reboot
- Description
- Shuts down Window and reboots the system.
- Syntax
- Examples
- Restart
- Description
- Shuts down system with warm Windows restart.
- Syntax
- Examples
- Suspend
- Description
- Puts the computer into suspend/standby power mode.
- Syntax
- Examples
- Windows
- Description
- Syntax
- Examples
- Timer
- Overview
- Powerpro has 26 customisable timers, identified by the single-letter labels a, b, c, ..., z.
- Actions
- Autosave
- Description
- Changes the interval between which timers are autosaved to the pcf file.
- Syntax
- Parameters
- n
- (integer) new time between saves, in seconds
- Specify 0 to stop PowerPro autosaving timers.
- Examples
- Timer.Autosave(600)
- Changes the timer autosave interval to 600 seconds.
- Notes
- PowerPro normally autosaves running timers to the current .pcf file every 300 seconds.
- Clear
- Description
- Zeros (clears) the specified timer or timers.
- Syntax
- Parameters
- timers
- (string) the timers to clear, as a single string with no spaces between each timer listed
- Examples
- Timer.Clear("a")
- Timer.Clear("fkt")
- Set
- Description
- Starts, stops or toggles the specified timer(s) and sets the value.
- Syntax
- Timer.Set("[cAxn][cAddSub]sTimers newHMS")
- Parameters
- cAxn
- (string) single character representing the action to take
- Optional, if omitted, the timer state is unchanged.
- Possible Values
- +
- timer(s) in sTimer parameter are started
- -
- timer(s) in sTimer parameter are stopped
- *
- timer(s) in sTimer parameter are toggled
- cAddSub
- (string) single character indicating whether to add, subtract or absolutely set the timer value
- Optional, if omitted, the timer is set to an absolute time as specified by newHMS parameter.
- Possible Values
- @
- add the value in newHMS parameter to current timer value
- $
- subtract the value in newHMS parameter from current timer value
- sTimers
- (string) single string of timer ID's to be set, with no spaces between them
- newHMS
- (string) the new timer value, as 3 space-separated integers: hours, minutes & seconds
- Examples
- Timer.Set("+a 0 0 0")
- Clears timer a and starts it.
- Timer.Set("+a 0 0 120")
- Starts timer a at 120 seconds.
- Timer.Set("bf 0 10 20")
- Resets timers b and f to 10 minutes, 20 seconds, leaving their running/stopped state unchanged.
- Timer.Set("-c 1 0 0")
- Stops timer c and sets its value to one hour.
- Timer.Set("@aq 2 3 0")
- Adds 2 hours and 3 minutes to timers a and q.
- Timer.Set("$q 2 3 0")
- Subtracts 2 hours and 3 minutes from timer q.
- Start
- Description
- Starts the specified timer or timers.
- Syntax
- Parameters
- timers
- (string) the timers to start, as a single string with no spaces between each timer listed
- Examples
- Timer.Start("a")
- Timer.Start("dgk")
- Starts the three timers d, g & k.
- StartStop
- Description
- Toggles the running of the specified timer or timers.
- Syntax
- Parameters
- timers
- (string) the timers to stop, as a single string with no spaces between each timer listed
- Examples
- Timer.StartStop("a")
- Starts timer a if it is stopped, else stops it.
- Timer.StartStop("dgk")
- Starts the three timers d, g & k, if they are stopped, else stops them.
- Stop
- Description
- Stops the specified timer or timers.
- Syntax
- Parameters
- timers
- (string) the timers to stop, as a single string with no spaces between each timer listed
- Examples
- Timer.Stop("a")
- Timer.Stop("dgk")
- Stops the three timers d, g & k.
- See Also
- PowerPro Help CHM > Built-in Commands > *Timer
- PowerPro Help CHM > Configuring with the GUI dialogs > Timers
- For more precise timing, see the built-in functions perfcount & perffreq:
- PPSR > Built-in Functions > Functions > by Category > Timers > perfcount
- PPSR > Built-in Functions > Functions > by Category > Timers > perffreq
- TrayIcon
- Overview
- The *TrayIcon command is used to simulate mouse clicks on tray icons from any program.
- Actions
- Dump
- Description
- Generates a file in the PowerPro folder called "trayicons.txt", containing a list of all tray icons.
- Syntax
- Examples
- Hide
- Description
- Hides specified tray icon from PowerPro & system tray.
- Syntax
- TrayIcon.Hide([^]caption_list[(id)])
- Parameters
- ^
- (string) a single carat character, ^, prepended to the icon name to avoid errors if the icon is not found
- caption_list
- (string) identifies which tray icon window to work with
- Possible Values::ULP
- The icon's window can be specified via its: ::DL
- caption
- *caption
- *caption*
- caption*
- cap*tion
- exe name
- window class
- id
- (mixed) Indicates which tray icon to use for a window when which controls more than one tray icon.
- Optional.
- Examples
- TrayIcon.Hide("=taskmgr")
- Hides the Task Manager icon from both PowerPro's & Windows' system trays.
- Notes
- Commands can still be sent to hidden icons.
- Left
- Description
- Simulates a left mouse click on the specified tray icon.
- Syntax
- TrayIcon.Left([^]caption_list[(id)])
- Parameters
- ^
- (string) a single carat character, ^, prepended to the icon name to avoid errors if the icon is not found
- caption_list
- (string) identifies which tray icon window to work with
- Possible Values::ULP
- The icon's window can be specified via its: ::DL
- caption
- *caption
- *caption*
- caption*
- cap*tion
- exe name
- window class
- id
- (mixed) Indicates which tray icon to use for a window when which controls more than one tray icon.
- Optional.
- Examples
- TrayIcon.Left("avast*")
- Simulates a left-click on the Avast! tray icon.
- TrayIcon.Show("^avast*")
- Sends a left-click to the Avast! icon, hiding any errors if Avast! is not running.
- LeftDouble
- Description
- Simulates a double left mouse click on the specified tray icon.
- Syntax
- TrayIcon.LeftDouble([^]caption_list[(id)])
- Parameters
- ^
- (string) a single carat character, ^, prepended to the icon name to avoid errors if the icon is not found
- caption_list
- (string) identifies which tray icon window to work with
- Possible Values::ULP
- The icon's window can be specified via its: ::DL
- caption
- *caption
- *caption*
- caption*
- cap*tion
- exe name
- window class
- id
- (mixed) Indicates which tray icon to use for a window when which controls more than one tray icon.
- Optional.
- Examples
- TrayIcon.LeftDouble("avast*")
- Simulates a double left-click on the Avast! tray icon.
- Refresh
- Description
- Refreshes the tray icons.
- Syntax
- Examples
- Notes
- Useful if tray icons stop functioning.
- Right
- Description
- Simulates a right mouse click on the specified tray icon.
- Syntax
- TrayIcon.Right([^]caption_list[(id)])
- Parameters
- ^
- (string) a single carat character, ^, prepended to the icon name to avoid errors if the icon is not found
- caption_list
- (string) identifies which tray icon window to work with
- Possible Values::ULP
- The icon's window can be specified via its: ::DL
- caption
- *caption
- *caption*
- caption*
- cap*tion
- exe name
- window class
- id
- (mixed) Indicates which tray icon to use for a window when which controls more than one tray icon.
- Optional.
- Examples
- TrayIcon.Right("avast*")
- Simulates a right-click on the Avast! tray icon.
- TrayIcon.Right("=explorer(2)")
- Simulates a right-click on the icon belonging to the Explorer-type window with id=2.
- RightDouble
- Description
- Simulates a double right mouse click on the specified tray icon.
- Syntax
- TrayIcon.RightDouble([^]caption_list[(id)])
- Parameters
- ^
- (string) a single carat character, ^, prepended to the icon name to avoid errors if the icon is not found
- caption_list
- (string) identifies which tray icon window to work with
- Possible Values::ULP
- The icon's window can be specified via its: ::DL
- caption
- *caption
- *caption*
- caption*
- cap*tion
- exe name
- window class
- id
- (mixed) Indicates which tray icon to use for a window when which controls more than one tray icon.
- Optional.
- Examples
- TrayIcon.RightDouble("avast*")
- Simulates a double right-click on the Avast! tray icon.
- Show
- Description
- Forces a tray icon to be shown in both PowerPro's & the system's tray.
- Syntax
- TrayIcon.Show([^]caption_list[(id)])
- Parameters
- ^
- (string) a single carat character, ^, prepended to the icon name to avoid errors if the icon is not found
- caption_list
- (string) identifies which tray icon window to work with
- Possible Values::ULP
- The icon's window can be specified via its: ::DL
- caption
- *caption
- *caption*
- caption*
- cap*tion
- exe name
- window class
- id
- (mixed) Indicates which tray icon to use for a window when which controls more than one tray icon.
- Optional.
- Examples
- TrayIcon.Show("=taskmgr")
- Shows the Task Manager icon in both PowerPro's & Windows' system trays.
- TrayIcon.Show("^=taskmgr")
- Shows the Task Manager icon in both PowerPro's & Windows' system trays, hiding any errors if Task Manager is not running.
- See Also
- PowerPro Help CHM > Built-In Commands > *TrayIcon > Working with tray icons from other programs
- Vdesk
- Overview
- The Vdesk command works with PowerPro's virtual desktops feature.
- Actions
- Arrange
- Description
- Displays a PowerPro Virtual Desktop Arrange window showing all desktops & windows on them.
- Syntax
- Examples
- Clear
- Description
- Clears the current desktop (closes all windows on it).
- Syntax
- Examples
- Notes
- Vdesk.Clear does not close windows that are visible on all desktops, as set via the PowerPro Config GUI > Desktops > Setup.
- ClearAllClose
- Description
- Move all windows to current desktop and then closes them.
- Syntax
- Examples
- Notes
- Vdesk.Clear does not close windows that are visible on all desktops, as set via the PowerPro Config GUI > Desktops > Setup.
- Consolidate
- Description
- Move all windows to current desktop & closes all other desktops.
- Syntax
- Examples
- CreateOrSwitchTo
- Description
- Switches to the specified desktop, if it exists, otherwise creates a new desktop named after the specified command list, then runs the commands on the list to populate the desktop.
- Syntax
- Vdesk.CreateOrSwitchTo(deskname)
- Parameters
- deskname
- (string) vdesk name or number
- Examples
- Vdesk.CreateOrSwitchTo("work")
- Switches to the desk named "work" if it exists, otherwise creates it.
- See Also
- Vdesk.CreateOrSwitchTo() is the same as Vdesk.NewFromList().
- Lock
- Description
- Locks all visible windows matching the specified caption list, so that they are visible on all desktops.
- Syntax
- Parameters
- cl
- (string) list of windows to lock
- Examples
- Vdesk.Lock("=notepad,*explorer*")
- Locks all visible Notepad & Explorer windows to all desktops.
- Menu
- Description
- Displays the virtual desktop menu.
- Syntax
- Examples
- Notes
- The virtual desktop menu can also be shown by Shift+right-clicking on a PowerPro bar.
- MoveActive
- Description
- Moves the active window to the specified desktop.
- Syntax
- VDesk.MoveActive(deskname)
- Parameters
- deskname
- (string) desktop name or number
- The desktop "deskname" must already exist.
- Examples
- VDesk.MoveActive("work")
- Moves the active window to the desktop named "work".
- VDesk.MoveActive(2)
- Moves the active window to the desktop #2.
- Version Compatibility
- Integer deskname parameter introduced in PowerPro 4.1.0.5.
- MoveAll
- Description
- Moves all windows on the source desktop matching the specified caption list to the destination desktop.
- Syntax
- Vdesk.MoveAll(from_desk, to_desk, cap_list)
- Parameters
- from_desk
- (mixed) source desktop, can be either:
- (string) desktop name
- (integer) desktop number
- to_desk
- (mixed) destination desktop, as per from_desk
- cap_list
- (string) comma-separated string caption
- Keywords
- *
- means the current desktop when used with:
- means all windows, when used with cap_list
- Examples
- Vdesk.MoveAll(2, "*", "=notepad,*explorer*")
- Moves all windows matching "=notepad" or "*explorer*" on desktop 2, to the current desktop.
- Notes
current prob's- Windows not in cap_list hidden if they're on from_desk, but current desktop is to_desk.
- Minimised windows not moved when "*" keyword for all windows used.
- MoveAutorun
- Description
- Moves last autorun window to the specified desktop.
- Syntax
- VDesk.MoveAutorun(deskname)
- Parameters
- deskname
- (string) desktop name or number
- The desktop "deskname" must already exist.
- Examples
- VDesk.MoveAutorun("work")
- Moves last autorun window to the desktop named "work".
- VDesk.MoveAutorun(2)
- Moves last autorun window to the desktop #2.
- Version Compatibility
- Integer deskname parameter introduced in PowerPro 4.1.0.5.
- New
- Description
- Syntax
- Parameters
- deskname
- (string) name to give the new desktop
- Optional, if omitted, desktop will just be numbered but not named.
- Examples
- Vdesk.New
- Creates a new desktop, which will be given the next available desktop number.
- Vdesk.New("work")
- Creates a new desktop named "work".
- See Also
- NewFromList
- Description
- Switches to the specified desktop, if it exists, otherwise creates a new desktop named after the specified command list, then runs the commands on the list to populate the desktop.
- Syntax
- Vdesk.NewFromList(deskname)
- Parameters
- deskname
- (string) vdesk name or number
- Examples
- Vdesk.NewFromList("work")
- Creates a new desktop named "work", or switches to it if it already exists.
- See Also
- Vdesk.NewFromList() is the same as Vdesk.CreateOrSwitchTo().
- Next
- Description
- Activates the next virtual desktop.
- Syntax
- Examples
- Previous
- Description
- Activates the previous virtual desktop.
- Syntax
- Examples
- ShowMenu
- Description
- Shows a menu of desktops & windows, then either:
- the selected window is moved to the current desktop.
- the selected desktop is activated.
- Syntax
- Examples
- SwitchMenu
- Description
- Shows a menu of desktops and windows, & the selected one is activated.
- Syntax
- Examples
- SwitchTo
- Description
- Switches to the specified desktop.
- Syntax
- Parameters
- deskname
- (mixed) name or number of the target desktop
- Examples
- Vdesk.SwitchTo("mydesk")
- Switches to the desktop named "mydesk".
- Vdesk.SwitchTo(3)
- ReplaceByList
- Description
- Clears the current desktop, renames it to the specified command list, then runs the commands on the named list to populate the desktop.
- Syntax
- Vdesk.ReplaceByList(list_name)
- Parameters
- list_name
- (string) name of a command list
- Examples
- Vdesk.ReplaceByList("stuff")
- Unlock
- Description
- Unlocks all windows matching the specified caption list, so that they are only visible on one desktop.
- Syntax
- Parameters
- cl
- (string) list of windows to unlock
- Examples
- Vdesk.Unlock("=notepad,*explorer*")
- Unlocks all Notepad & Explorer windows.
- See Also
- PowerPro Help CHM > Built-in Commands > *Vdesk
- Wait
- Overview
- The Wait command is used to wait for some condition before continuing. The condition can be an amount of time, an expression, or both, depending on the command & action used.
- Waits should always be used after commands which act on other windows, as after PowerPro sends the window a message asking it to do something, the window itself must have time to respond.
- Actions
- Activity
- Description
- Waits for mouse or keyboard activity.
- Syntax
- Examples
- Wait.Activity
messagebox("ok", "Welcome Back!", "PP Greeting")
- Notes
- Always waits at least 3 seconds to ignore activity associated with launching the command.
- For
- Description
- Wait for specified length of time, or for an expression to evaluate to true.
- Syntax
- Wait.For(n, expr)
- Waits up to n milliseconds for expression expr to become true.
- Wait.For(n)
- Wait.For(expr)
- Waits for expression expr to become true.
- Parameters
- n
- (integer) length of time in milliseconds
- expr
- (bool) expression to evaluate
- Examples
- Wait.For(300)
- Wait.For(activewindow("=notepad"))
- Wait.For(300, activewindow("=notepad"))
- Notes
- Only one Wait.For() can be running at a time.
- Nested Wait.For()'s are always stopped in reverse order of issuance.
- Wait.For() will not accept an argument from a function call as its n parameter [length of time to wait] when the syntax being used is Wait.For(n), where n is an integer.
i.e. The following will not wait, no matter what arg(1) evaluates to:
Wait.For( arg(1) )
To use the value of arg(1) in the Wait.For() call, use:
- Wait.ForInterval()
- the &() format: Wait.For( &(arg(1)) ) [deprecated]
- See Also
- ForInterval
- Description
- Waits for specified amount of time.
- Syntax
- Parameters
- n
- (integer) time to wait, in milliseconds
- Examples
- Wait.ForInterval(300)
- Waits for 300 milliseconds.
- Wait.ForInterval( arg(2)*4 )
- Waits for the value of "arg(2) times 4" milliseconds.
- Notes
- Wait.ForInterval() accepts as a parameter an argument from a function call:
Wait.ForInterval( arg(1) )
which the normal Wait.For() command doesn't allow.
- Message
- Description
- Displays a message box with specified msg and, optionally, a countdown timer starting at n seconds, & waits for user to press a button to determine whether to continue.
- Syntax
- Wait.Message(n, msg)
- Shows message msg for up to n seconds.
- Wait.Message(msg)
- Shows message msg for 1 second.
- Parameters
- n
- (integer) length of countdown, in seconds.
- If countdown reaches 0, then the wait ends and the next PowerPro command is run.
- Optional, default is 1.
- msg
- (string) message to display in message box
- UI Elements
- [button:] Start Now
- If pressed, the Wait.Message call ends & the next PowerPro command is run.
- [button:] Cancel
- If pressed, the Wait.Message call ends & the PowerPro script exits.
- Examples
- Wait.Message("Shutting down...")
Shutdown.Windows
- Wait.Message(10, "Rebooting in 10 seconds...")
Shutdown.Reboot
- Quit
- Description
- Syntax
- Examples
- Ready
- Description
- Wait for specified program(s) to be ready to accept input.
- Syntax
- Parameters
- cl
- window id or caption list
- Examples
- Notes
- Waits for a maximum of 10 seconds.
- Cannot be used in scripts called from another script.
- Until
- Description
- Wait until specified length of time, or until an expression evaluates to true.
- Syntax
- Wait.Until(n, expr)
- Waits until expression expr becomes true, up to a maximum of n milliseconds.
- Wait.Until(n)
- Wait until n milliseconds.
- Wait.Until(expr)
- Waits until expression expr becomes true.
- Parameters
- n
- (integer) length of time in milliseconds
- expr
- (string) expression to evaluate
- Examples
- Wait.For(300)
- Wait.For(activewindow("=notepad"))
- Wait.For(300, anywindow("=notepad"))
- Notes
- Wait.Until() cannot be used inside a do( ) command.
- Multiple independent waits can run concurrently.
- See Also
- PowerPro offers a few other types of waits:
- the Event Plugin
- PPSR > Plugins > The Plugins > Event
- File.RunCallBack() in the File plugin
- PPSR > Plugins > The Plugins > File > Services > RunCallBack
- File.RunWait() in the File plugin
- PPSR > Plugins > The Plugins > File > Services > RunWait
- Wallpaper
- Overview
- The Wallpaper command is used to change the desktop wallpaper.
- Actions
- Change
- Description
- Changes the wallpaper to another file from the same folder as the current desktop wallpaper file.
- Syntax
- Parameters
- order
- (string) determines how the next file is selected
- Possible Values
- *
- changes to the next file in Name sequence
- omitted
- Examples
- Wallpaper.Change
- Changes the desktop wallpaper to a random file from the same folder as the current wallpaper.
- Wallpaper.Change("*")
- Changes the desktop wallpaper to the next file from the same folder as the current wallpaper.
- Notes
- IrfanView (and possibly other image management software) has a "Set as Wallpaper" feature, which stores a copy of the selected image in its own folder, overwriting it each time a new image is selected. As such, PowerPro's Wallpaper.Change feature will appear not to work if desktop wallpaper has been set via such programs.
- ChangeTo
- Description
- Changes the desktop wallpaper to the specified file, & saves the details in the current .pcf.
- Syntax
- Wallpaper.ChangeTo(filespec)
- Parameters
- filespec
- (string) new wallpaper file
- Examples
- Wallpaper.ChangeTo(?"d:\textures\pattern_003.bmp")
- Changes the wallpaper to "pattern_003.bmp" & stores that file name in the current .pcf.
- See Also
- Wallpaper.Show(), which is similar but does not store the new file name.
- Show
- Description
- Changes the desktop wallpaper to the specified file, but does not save the new file details in the current .pcf.
- Syntax
- Parameters
- filespec
- (string) new wallpaper file
- Examples
- Wallpaper.Show(?"d:\textures\pattern_003.bmp")
- Changes the wallpaper to "pattern_003.bmp".
- See Also
- Wallpaper.ChangeTo(), which is similar but also stores the new file name.
- Style
- Description
- Sets the wallpaper file layout
- Syntax
- Parameters
- display
- (string) sets picture display style
- Possible Values
- Examples
- Wallpaper.Style("tile")
- Sets wallpaper display style to "Tile".
- Notes
- .bmp, .jpg & .jpeg files may be used as desktop wallpaper.
- Window
- Overview
- The Window commands allow manipulation of the windows of running programs.
- Actions
- AutoMin
- Description
- Minimises all windows matching the specified caption list in one of 2 ways depending on whether each individual window is listed in the "Auto tray min" list on the PowerPro Config GUI > Setup tab or not, either minimising the window to the tray, or performing an ordinary minimise.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Automin("active")
- Minimises the active window to the tray or to the task bar.
- Back
- Description
- Sends all windows matching the specified caption list to the bottom of the stack of displayed windows.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Back("active")
- Sends the active window to the back.
- BackShow
- Description
- Toggles backmost/foremost setting of each window matching the specified caption list, sending it to the back if foremost, else activating it.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.BackShow("*notepad")
- Sends each visible Notepad window to the back of the stack if it's active, else activates it.
- Notes
- Each matching window is toggled separately, with respect to its own current state.
- Center
- Description
- Centres the specified window(s) within the full screen area.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Center("=pproconf")
- Centres the PowerPro Config dialog on the screen.
- Close
- Description
- Closes the specified window(s).
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Close("under")
- Closes the window under the mouse.
- Close2
- Description
- Closes the specified window(s) using a different technique than Window.Close().
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Close2("under")
- Closes the window under the mouse.
- Notes
- Window.Close2() may work when Window.Close() does not.
- Window.Close2() will also close hidden windows.
- CloseForce
- Description
- Forces the specified window(s) to close, possibly losing any unsaved information.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.CloseForce("*notepad")
- Forces all Notepad windows to close without saving.
- Hide
- Description
- Makes a window invisible.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Hide("menu")
- Shows a menu of visible windows, then hides the selected window.
- HideShow
- Description
- Toggles a window's visibility.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Hide("menu")
- Shows a menu of visible windows, then hides the selected window.
- Notes
- Take care when applying Window.HideShow() to multiple windows, as there are many windows which should normally remain invisible.
- Max
- Description
- Maximises the specified window(s).
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Max("under")
- Maximises the window under the mouse.
- Window.Max("*metapad")
- Maximises all visible Metapad windows.
- MaxNormal
- Description
- Toggles the maximised state of the specified window(s).
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.MaxNormal("active")
- Maximises the active window if it is currently unmaximised, else restores it to normal state.
- Notes
- Each matching window is toggled separately, with respect to its own current state.
- Min
- Description
- Minimises the specified window(s).
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Min("*firefox")
- Minimises all visible Firefox windows.
- MinMemory
- Description
- Sets the memory working set for the specified window(s).
- Windows NT only.
- Syntax
- Window.MinMemory(cl, min, max)
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- min
- (float) minimum working set size in bytes
- Optional, see Notes below for more.
- max
- (float) maximum working set size in bytes
- Optional, see Notes below for more.
- Examples
- Window.MinMemory("active")
- Notes
- If the parameters min & max are omitted, or if both are specified as -1, the function temporarily trims the working set of the specified process to zero, essentially swapping the process out of physical RAM memory.
- The virtual memory manager attempts to keep at least the minimum working set size resident in the process whenever the process is active and to keep no more than the maximum memory resident in the process whenever the process is active and memory is in short supply.
- MinRestore
- Description
- Toggles the minimised state of each window matching the specified caption list.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.MinRestore("*metapad")
- For each visible Metapad window, restores it if minimised, else minimises it.
- Notes
- Each matching window is toggled separately, with respect to its own current state.
- Move
- Description
- Sets the specified window(s) to move with the mouse until any mouse button is pressed.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Move("under")
- Sets the window under the mouse to be moved by the mouse's movements until a mouse button is pressed.
- Normal
- Description
- Restores all windows matching the specified caption list to "Normal" size (not minimised or maximised).
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Normal("*firefox")
- Restores all visible Firefox windows.
- NotTop
- Description
- Removes any "Always On Top" settings for all windows matching the specified caption list.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.NotTop("under")
- Removes the "Always on top" setting of the window under the mouse.
- OnTop
- Description
- Sets all windows matching the specified caption list to be "Always on top".
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.OnTop("under")
- Sets the window under the mouse to be on top, so that it is always above other windows.
- PostMessage
- Description
- Sends a WinAPI PostMessage() call to each window matching the specified caption list.
- Syntax
- Window.PostMessage(msg, wp, lp, han)
- Parameters
- msg
- (mixed) the message to be posted
- Possible Values
- wm_command
- wm_app
- wm_user
- wm_user+n
- wp
- (integer) specifies additional message-specific information
- lp
- (integer) specifies additional message-specific information
- han
- (mixed) handle or class of the window(s) to act on
- Return Value
- Examples
- Window.PostMessage_("wm_command", 1193, 0, "c=i_view32")
- Toggles the menubar in IrfanView.
- Window.PostMessage(0x112, 0xF170, 2, 0xFFFF)
- Turns off the screen.
- Use -1 as the 3rd parameter to turn the screen on, or 1 to make it dimmed.
- Notes
- The WinAPI PostMessage() function posts a message in the message queue associated with the thread that created the target window, then returns immediately, without waiting for the message to be processed.
- Precede parameter integer values with "0x" to indicate a hexadecimal number, for example:
- Note that Window.PostMessage() is generally safer to use than Window.SendMessage(), unless a return is needed from the message handler.
- See Also
- Window.SendMessage()
- PPSR > Built-in Commands > Commands > Window > Actions > SendMessage
- http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/postmessage.asp
- Position
- Definition
- Repositions and/or resizes target window according to values specified.
- New size & position values may be keywords, a positive or negative number (in quotes), or the equals sign.
- Syntax
- Window.Position(x, y, w, h, cl)
- Parameters
- x
- (string) x-coordinate of window
- y
- (string) y-coordinate of window
- w
- h
- (string) height of window
- cl
- (mixed) caption list identifying target window(s)
- Keywords for x, y, w, h
- "="
- "+"
- prepended to the value
- value is calculated relative to current position
- "center"
- window is centred on screen
- "hmax"
- "wmax"
- Examples
- Window.Position("=", "=", "300", "200", "active")
Window.Position("= = 300 200", "active")
Window.Position("= = 300 200 active")
Window.Position("=", "= 300", "200 active")
- Resizes active window to 300x200.
- Note that each of the Window.Position() calls here has the same effect.
PowerPro accepts any combination of the 5 parameters as separate strings in the Window.Position() call:- 5 separate string values
- a single string containing 5 space-separated values
- 2, 3, or 4 comma-separated strings, each containing a number of space-separated values
- Window.Position("0", "0", "=", "hmax/2", "=notepad")
- Moves notepad to top left corner of screen & resizes it to half maximum height.
- Window.Position("+-50", "+-80", "=", "=", "active")
- Moves active window 50px left and 80px up.
- Window.Position("++100", "++150", "=", "=", "active")
- Moves active window 100px right and 150px down.
- Window.Position("++100 ++150 = = active")
- This has the same effect as the above example, but it is written differently, with all parameters given in a single space-separated string.
- Notes
- See the Win plugin for other ways to resize & move windows.
- Rollup
- Description
- Toggles a window's "rolled-up" state, rolling it up to just its caption if it is fully visible, or showing it again if it is already rolled-up.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Rollup("under")
- Rolls up the window under the mouse.
- SendMessage
- Description
- Sends a WinAPI SendMessage() call to each window matching the specified caption list.
- Syntax
- Window.SendMessage(msg, wp, lp, han)
- Parameters
- msg
- (mixed) the message to be sent
- Possible Values
- wm_command
- wm_app
- wm_user
- wm_user+n
- wp
- (integer) specifies additional message-specific information
- lp
- (integer) specifies additional message-specific information
- han
- (mixed) handle or class of the window(s) to act on
- Return Value
- (mixed) depends on the message sent
- Examples
- Window.SendMessage("wm_command", 40046, 0, "c=winamp v1.x")
- Window.SendMessage("wm_user", 1, 105, "c=winamp v1.x")
- Sets variable SendMessage to length of current track
- Notes
- The WinAPI function, SendMessage, sends the specified message to the target window(s), calling the window procedure & waiting for it to process the message before returning.
- Precede parameter integer values with "0x" to indicate a hexadecimal number, for example:
- Note that Window.PostMessage() is generally safer to use than Window.SendMessage(), unless a return is needed from the message handler.
- See Also
- Window.PostMessage()
- PPSR > Built-in Commands > Commands > Window > Actions > PostMessage
- http://msdn.microsoft.com/library/en-us/winui/winui/WindowsUserInterface/Windowing/MessagesandMessageQueues/MessagesandMessageQueuesReference/MessagesandMessageQueuesFunctions/SendMessage.asp
- SetPriority
- Description
- Sets process priority of specified window.
- Syntax
- Window.SetPriority(amount, cl)
- Parameters
- amount
- (string) new process priority
- Possible Values
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.SetPriority("high", "=myprog")
- Sets the process priority of the program MyProg to high.
- Show
- Description
- Activates the specified window & shows it if hidden.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Show("=notepad")
- Shows the first notepad found.
- Window.Show("menu =notepad")
- Shows a menu of Notepad windows, & one selected from the list is brought to the front.
- Notes
- PowerPro accepts anything for the 2nd part of a Window.Show("menu...") statement, including nothing. If it doesn't recognise the word or reference, an empty menu will be shown.
- Size
- Description
- Enables the user to size the window by moving the mouse; click any mouse button to stop.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Size("*metapad")
- Allows the user to resize a Metapad window by moving the mouse.
- TopNotTop
- Description
- Toggles the "Always on top" setting for each window matching the specified caption list.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.OnTop("under")
- Sets the window under the mouse to be on top, so that it is always above other windows.
- Notes
- Each matching window is toggled separately, with respect to its own current state.
- Trans
- Description
- Makes all windows matching the specified caption list transparent.
- Windows 2000 and XP only.
- Syntax
- Parameters
- n
- (number) transparency value
- -254<n<255 where:
- 0
- 255
- negative values
- toggle transparency setting
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.Trans(-254, "HTML Help*PowerPro")
- Toggles the transparency setting of the PowerPro Help CHM file between 0 (no transparency) and 254 (transparent).
- See Also
- Window.TransMouse()
- PPSR > Built-in Commands > Commands > Window > Actions > TransMouse
- TransMouse
- Description
- Makes all windows matching the specified caption list transparent, as well as making all mouse clicks pass through them.
- Windows 2000 and XP only.
- Syntax
- Parameters
- n
- (number) transparency value
- -254<n<255 where
- 0
- 255
- negative values
- toggle transparency setting
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.TransMouse(-80, "HTML Help*PowerPro")
- Toggles the transparency setting of the PowerPro Help CHM file between 0 and 100, as well as making mouse clicks pass through it to the window below.
- See Also
- Window.Trans()
- PPSR > Built-in Commands > Commands > Window > Actions > Trans
- TrayMin
- Description
- Minimizes all windows matching a caption list to the system tray.
- Syntax
- Parameters
- cl
- (mixed) caption list identifying target window(s)
- Examples
- Window.TrayMin("*firefox")
- Tray-minimises all firefox windows.
- Specifying the Window Id
- The window identifier (wid parameter) can be:
- Any standard caption list item
- See:
- PPSR > Language Reference > Caption Lists
- PPSR > Language Reference > Window Id's
- Extra wid keywords for Window.[Action]() commands
- *
- all
- hidden
- menu
- Displays a menu of active windows allowing user to select one to receive the command.
Put "noembed" (must be lowercase) after keyword to..?
- menu hidden
- Similar to "menu", except the list includes active, hidden, & tray-minimised windows.
- menu onlyhidden
- Similar to "menu", except the list only includes hidden windows.
- menu trayminned
- Similar to "menu", except the list includes active & tray-minimised windows. (No hidden windows, though.)
- menux
- Similar to menu, except that if only one window matches the specified captionlist, then command is executed on that window without showing the menu.
- Avoiding Errors
- Put an underscore _ after the action name to avoid an error message if the window does not exist.
- E.g.
- Window.Close_("*notepad*)
- Closes any open notepad windows, but does nothing if there are none open.
- Notes
- Underscore only works with the Window built-in command.
- Underscore only works with expression syntax -- for Literal Syntax, use an exclamation mark (!) instead.
- Notes
- Script & Format commands do not use the new Expression Syntax given in the General Syntax section above.