【发布时间】:2016-11-16 19:48:31
【问题描述】:
我有许多未命名的 TextEdit 文件。我想使用 applescript 来保存每个文档的第一行文本作为名称。
以下将选择并复制文档的第一行(不优雅,但它有效),但我不知道如何将剪贴板粘贴到保存对话框中(然后点击“保存”)。有人可以帮忙吗?
tell application "TextEdit" to activate
tell application "TextEdit"
tell application "System Events" to key code 126 using command down
tell application "System Events" to key code 125 using shift down
tell application "System Events" to key code 8 using command down
end tell
【问题讨论】:
-
只需使用提供名称和路径的“另存为”指令。
-
名字在剪贴板上。我想以这种方式自动命名。
标签: applescript textedit