AppleScript“另存为”对话框?(AppleScript “Save As” dialog?)

编程入门 行业动态 更新时间:2024-10-26 22:26:37
AppleScript“另存为”对话框?(AppleScript “Save As” dialog?)

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

我知道Open对话框的代码:

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

What is the AppleScript code for a "Save As" dialog with a custom file type extension?

I know the code for Open dialog:

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 commands are found in applications themselves, not within standard additions. If you are trying to establish a path to pass to a save command, you can use something like this:

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"

更多推荐

本文发布于:2023-08-07 16:00:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464907.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:另存为   对话框   AppleScript   Save   dialog

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!