首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何告诉Applescript告诉Acrobat单击“如果/出现时不保存”按钮

如何告诉Applescript告诉Acrobat单击“如果/出现时不保存”按钮
EN

Stack Overflow用户
提问于 2014-06-27 15:54:55
回答 1查看 769关注 0票数 1

这是我的密码。只要是PDF格式,就能正常工作。但是,如果在命令窗口关闭后打开JPEG,则会弹出一个新的对话框,并询问是否要将文档保存为PDF。我只想告诉它点击不要保存,然后继续.我搞不懂..。

代码语言:javascript
复制
tell application "Adobe Acrobat Pro"
        activate -- bring up acrobat
        open alias mycurrentfile -- acrobat opens that new file    
        tell application "System Events"
            tell process "Acrobat"
                click menu item "Print..." of menu 1 of menu bar item "File" of menu bar 1
                click button "Print" of window "Print"
                tell application "System Events"
                    tell process "Acrobat"
                        click menu item "Close" of menu 1 of menu bar item "File" of menu bar 1

                    end tell
                end tell
            end tell
        end tell
    end tell
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-06-27 17:07:41

代码语言:javascript
复制
tell application "Adobe Acrobat Pro"
    activate -- bring up acrobat
    open alias mycurrentfile -- acrobat opens that new file    
    tell application "System Events"
        tell process "Acrobat"
            click menu item "Print..." of menu 1 of menu bar item "File" of menu bar 1
            click button "Print" of window "Print"
        end tell
    end tell
    close document 1 without saving
end tell

如果你只是想打印pdf,最好使用预览

代码语言:javascript
复制
set mycurrentfile to choose file
tell application "Preview"
    print mycurrentfile without print dialog
end tell
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24456028

复制
相关文章

相似问题

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