如何使用 AppleScript 保存、关闭和退出 Keynote?

发布于 2024-12-27 12:44:25 字数 556 浏览 2 评论 0原文

导出幻灯片后保存、关闭并退出 Keynote 的正确 Applescript 语法是什么?我对 Applescript 不太有经验。有没有更高效的东西可以使用?外壳脚本?还需要获取执行的 Applescript 的成功/失败。

我正确打开了 Keynote 演示文稿,导出了幻灯片,但似乎无法让 Keynote 保存演示文稿、正确关闭它并退出。

尝试了多种变体:

“告诉应用程序“系统事件”

“告诉进程“Keynote”

“保存”

“结束告诉”

“告诉进程“Keynote”

“关闭”

“结束告诉”

“告诉应用程序“Keynote”

“关闭”

也尝试过:

“告诉应用程序”系统事件“”

告诉进程“Keynote”

”单击菜单栏“文件”菜单项“关闭”菜单栏1的“文件”

项“单击菜单“Keynote”菜单项“退出Keynote”菜单栏项目的菜单栏1的“文件”

“结束告诉”

“结束告诉”

What's the proper Applescript syntax to save, then close and then exit Keynote after exporting slides? I'm not very experienced in Applescript. Is there something more efficient to use? Shell scripts? Need to also get success/failure of the executed Applescript.

I get the Keynote presentation opened correctly, export the slides, but cannot seem to get Keynote to save the presentation, close it properly and exit.

Tried multiple variations of:

"tell application "System Events"

" tell process "Keynote"

" Save"

" end tell"

" tell process "Keynote"

" Close"

" end tell"

"tell application "Keynote"

" Close "

Also tried:

"tell application "System Events"

" tell process "Keynote"

" click menu item "Close" of menu "File" of menu bar item "File" of menu bar 1"

" click menu item "Quit Keynote" of menu "Keynote" of menu bar item "File" of menu bar 1 "

"end tell"

"end tell"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不奢求什么 2025-01-03 12:44:25

如果仅打开一个演示文稿并且已保存该演示文稿,则以下操作将起作用(不会提示输入保存位置)。

tell application "Keynote"
    save
    quit
end tell

The following will work if there is only one presentation open and it has already been saved (Won't prompt for a save location).

tell application "Keynote"
    save
    quit
end tell
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文