Macos AppleScript";另存为;对话

Macos AppleScript";另存为;对话,macos,dialog,applescript,file-type,save-as,Macos,Dialog,Applescript,File Type,Save As,具有自定义文件类型扩展名的“另存为”对话框的AppleScript代码是什么 我知道打开对话框的代码: set theFiles to (choose file of type {"set"} with prompt "Save As File" without multiple selections allowed) as string 保存命令可以在应用程序本身中找到,而不是在标准添加中找到。如果您试图建立传递到save命令的路径,可以使用以下方法: set resultFile to (

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

我知道打开对话框的代码:

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

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

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"

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

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"