AppleScript“另存为”对话框?

时间:2013-07-08 15:49:40

标签: macos dialog applescript file-type save-as

带有自定义文件类型扩展名的“另存为”对话框的AppleScript代码是什么?

我知道Open对话框的代码:

set theFiles to (choose file of type {"set"} with prompt "Save As File" without multiple selections allowed) as string

1 个答案:

答案 0 :(得分:4)

保存命令可在应用程序本身中找到,而不是在标准添加中。如果您尝试建立传递给保存命令的路径,可以使用以下内容:

set resultFile to (choose file name with prompt "Save As File" default name "My File" default location path to desktop) as text
if resultFile does not end with ".txt" then set resultFile to resultFile & ".txt"