Handle Save File Dialog
Verb: handleSaveFileDialog
Available from: <Standard>
Handles a save file dialog box by saving the file in the given directory.
Syntax
handleSaveFileDialog --filepath(String) [--useregex(Boolean)] [--title(String)] --regexPattern(String) [--regexOptions(DisplayableRegexOptions)] [--id(String)] [--processid(Numeric)] [--processname(String)] [--byparent(Boolean)] [--window(Window)] [--safesearch(Boolean)] [--timeout(TimeSpan)] (Window)=value (Numeric)=processId (Boolean)=success
Inputs
| Script | Designer | Required | AcceptedTypes | Description |
|---|---|---|---|---|
| --filepath | File path | Required | Text | Full path to where the file should be saved. |
| --useregex | Use Regular Expression | Optional | Boolean | Enables the use of regular expression to find the save file dialog. |
| --title | Title | Optional | Text | Title of the save file dialog that should be handled. |
| --regexPattern | Regular Expression | Only whenUse Regular Expression is True | Text | Regular expression used to identify the save file dialog that should be handled. |
| --regexOptions | Options | Optional | DisplayableRegexOptions | Options for regular expression matching:
|
| --titleAsRegex | Title is regular expression(Obsolete) | Optional | Boolean | When enabled, allows the use of a "Regular Expression" to search for the window title.
This parameter is obsolete, the Use Regular Expression parameter should be used instead. |
| --ignorecase | Ignore case(Obsolete) | Optional | Boolean | When enabled, specifies case-insensitive matching.
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --dotmatchesnewline | Dot matches new line(Obsolete) | Optional | Boolean | When enabled, the dot (.) character matches every character, instead of every character except "\n".
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --freespacing | Ignore white space(Obsolete) | Optional | Boolean | When enabled, eliminates blank spaces and breaks without adding a escape character.
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --explicitcapture | Explicit capture(Obsolete) | Optional | Boolean | When enabled, specifies that the only valid captures are explicitly named or numbered groups of the form (?
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --multiline | Multiline(Obsolete) | Optional | Boolean | When enabled, changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --id | Identifier | Optional | Text | Id of the save file dialog that should be handled. |
| --processid | Process Id | Optional | Number | Id of the process the save file dialog belongs to. |
| --processname | Process Name | Optional | Text | Name of the process the save file dialog belongs to. |
| --byparent | Search Associated Window | Optional | Boolean | When enabled, searches for child windows inside the window attached to the execution context. |
| --window | Window | Optional | Window | Main window in which the child windows are searched. |
| --safesearch | Safe Search | Optional | Boolean | When enabled, performs a faster search algorithm to locate the window. |
| --timeout | Timeout | Optional | Time Span, Number, Text | Maximum time to execute the command.
If no value is defined in the timeout parameter, the execution uses the context time defined by the Set Timeout command. If the script does not use that command, the default time is 5 seconds. |
Outputs
| Script | Designer | AcceptedTypes | Description |
|---|---|---|---|
| value | Save file dialog box | Window | Returns the save file ialog found. |
| processId | Process Id | Number | Returns the process Id of the save file dialog. |
| success | Success | Boolean | Returns "True", if the command is executed correctly, or "False" if otherwise. |
Example
Example 1: The command handles a dialog box that corresponds to the action of saving the Notepad file on the desktop.
defVar --name window --type Window
defVar --name processId --type Numeric
defVar --name desktopPath --type String
launchWindow --executablepath "notepad.exe" window=value processId=processId
clickOnMenu --window ${window} --menupath "file\r\nsave"
getSpecialFolder --folder "Desktop" desktopPath=value
handleSaveFileDialog --filepath "${desktopPath}\\File.txt" --title "Save As"
logMessage --message "End\r\nFile path: ${desktopPath}\\File.txt" --type "Info""
Example 2: Similar to the previous one, however, using shortcut keys to activate the dialog box to be handled and using a regular expression to find said dialog box.
defVar --name window --type Window
defVar --name processId --type Numeric
defVar --name desktopPath --type String
launchWindow --executablepath "notepad.exe" window=value processId=processId
keyboard --type "KeyPress" --key "ControlKey"
keyboard --type "KeyDown" --key "S"
keyboard --type "KeyUp" --key "ControlKey"
getSpecialFolder --folder "Desktop" desktopPath=value
handleSaveFileDialog --filepath "${desktopPath}\\File.txt" --useregex --regexPattern "(Sa?v?e?)" --regexOptions "IgnoreCase, Multiline" --byparent
// handle the Dialog Box and save the file on the Desktop.
logMessage --message "\r\nFile path: ${desktopPath}\\File.txt" --type "Info"