首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用AppleScript自动化如何获取当前打开的Adobe reader文件名

使用AppleScript自动化如何获取当前打开的Adobe reader文件名
EN

Stack Overflow用户
提问于 2020-04-28 00:39:05
回答 1查看 95关注 0票数 0

我尝试了下面的代码

代码语言:javascript
运行
复制
activate application "Adobe Reader"

tell application "System Events"
    tell process "Adobe Reader"
        set currentFile to active Document


    end tell
end tell

但是我无法获取活动文档的名称,我已经用打开的文档尝试了这段代码。我甚至在脚本编辑器中找不到任何适用于adobe阅读器的字典。如有任何建议,我们将不胜感激

EN

回答 1

Stack Overflow用户

发布于 2020-04-28 04:11:41

这里有几个可能对你有用的AppleScript选项。我没有Adobe Reader,所以我无法测试代码。

代码语言:javascript
运行
复制
tell application "Adobe Reader" to set currentFile to name of document 1

如果这对你不起作用,你可以试试这个…

代码语言:javascript
运行
复制
tell application "Adobe Reader" to activate

repeat until application ""Adobe Reader" is frontmost
    delay 0.1
end repeat

tell application (path to frontmost application as text) to set currentFile to name of document 1
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61463822

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档