打开另存为对话框
动词:saveFileAs
可从以下位置获取: <Standard>
打开“另存为”对话框,用户可以确定要保存的文件的目录、名称和扩展名。
语法
saveFileAs --title(String) --filter(String) (String)=value
输入
| 脚本 | 设计器 | 必需的 | AcceptedTypes | Description |
|---|---|---|---|---|
| -- 标题 | 标题 | 必需的 | 文本 | 要在对话框中显示的标题。 |
| --filter | 过滤器 | 必需的 | 文本 | 用于定义要保存的文件的扩展名的文本。在此参数中,通知的文本根据文件扩展名对“另存为”窗口中的文件类型进行过滤,例如:要过滤文本文件,请使用以下过滤器:*.txt。 要始终使用有效的扩展名格式,这很重要。 例如, *。[File extension]。 |
输出
| 脚本 | 设计器 | AcceptedTypes | Description |
|---|---|---|---|
| 值 | 文件路径 | 文本 | 返回要保存文件的完整路径。 |
示例
使用打开另存为对话框,用户可以定义要创建文本文件的目录以及文件名,以便写入文件命令可以将该目录用作参考,并按给定的指示信息进行写入。
defVar --name filePath --type String
defVar --name fileExtension --type String --value "*.txt"
defVar --name text --type String --value "Inteligent automation is IBM\'s specialty!"
saveFileAs --title "Save As..." --filter "${fileExtension}" filePath=value
writeToFile --value "${text}" --file "${filePath}" --writeasnewline
// The console displays where the text file with the message is, according to the user's selection.
logMessage --message "Location where the file was saved: ${filePath}" --type "Info"
文件名将始终是保存时在对话框中定义的名称。