Print to Web Receipts文件夹是否有热键/快捷方式?


0

我喜欢Safari中的“将PDF保存到Web收据文件夹”,并且一直使用它。唯一的小麻烦是它需要几个步骤(cmd + P - >点击“PDF” - >>选择“将PDF保存到Web收据文件夹”)才能使用它。有没有办法为它设置一个热键/快捷键,以便它只需要一个快速键组合?


Example of the 'Save PDF to Web Receipts Folder' function in Safari

Answers:


1

使用GUI脚本创建一个非常基本的Automator Service Applescript。然后,使用系统首选项中的键盘快捷键分配快捷方式。

  1. 打开Automator并选择“服务”

  2. 在“运行Applescript”动作中过去这个脚本。

    tell application "System Events"
        get system attribute "sysv"
        if result is greater than or equal to 4144 then -- Mac OS X 10.3.0
            if UI elements enabled then
                tell application "Safari" to activate
                keystroke "p" using command down
                tell application process "Safari"
                    tell application "System Events"
                        tell process "Safari"
                            click menu button "PDF" of sheet 1 of window 1
                            delay 1
    
                            click menu item "Save PDF to Web Receipts Folder" of menu of menu button "PDF" of sheet 1 of window 1
                        end tell
                    end tell
                end tell
            else
                beep
                display dialog "GUI Scripting is not enabled" & return & return & "Open System Preferences and check Enable Access for Assistive Devices in the Accessibility (or Universal Access) preference pane, then run this script again." with icon stop
                if button returned of result is "OK" then
                    tell application "System Preferences"
                        activate
                        set current pane to pane "com.apple.preference.universalaccess"
                    end tell
                end if
            end if
        else
            beep
            display dialog "This computer cannot run this script" & return & return & "The script uses GUI Scripting technology, which requires an upgrade to Mac OS X 10.3 Panther or newer." with icon caution buttons {"Quit"} default button "Quit"
        end if
    end tell
    
  3. 将输入设置为“无输入”,将应用程序设置为“Safari.app”

  4. 保存Automator服务。

  5. 在仍然使用Automator(或任何应用程序)时,请转到应用程序的“服务”菜单,然后选择“服务首选项”。

  6. 向下滚动,直至看到新服务。

  7. 分配快捷方式,单击确定,然后完成。


我第一次尝试时遇到了一些麻烦。问题是我有另一个全球热键与我试图使用的热键相冲突。一旦我改变它,它开始按预期工作。谢谢!
Alan W. Smith
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.