Shortcut for Preview sketch tool Nearly every time I open Preview.app I will then immediately press the toolbox button and then the sketch button.



Is there a shortcut to access the sketch tool or some way to put the sketch button on my default toolbar?
This workaround applies to Preview.app 9.0 (909.12) in macOS Sierra 10.12.2 and will most likely break in future releases.


Launch AppleScript Editor and enter the following.

tell application "System Events" to tell process "Preview"
    activate
    set markup to checkbox 1 of toolbar 1 of window 1
    tell markup
        if not (its value as boolean) then
            click markup
            delay 0.1
        end if
    end tell
    set sketch to checkbox 1 of toolbar 2 of window 1
    tell sketch
        if not (its value as boolean) then
            click sketch
        end if
    end tell
end tell

Launch Preview, open a document, switch back to AppleScript Editor, and run your script. You will most likely get at least one error about AppleScript Editor requiring permission to use accessibility features.
Open System Preferences. Open the Security &amp; Privacy pane. Click the Privacy tab. Click Accessibility. Click "Click the lock to make changes." Enter your password and click Unlock. Click the plus sign. Select Automator and click Open. Repeat, adding Script Editor. Make sure the checkboxes next to Automator and Script Editor are checked in the list.


(Hopefully, you'll only have to do step 3 once... until the next macOS upgrade.)


Go back to Script Editor, and try running your script again. Hopefully, in Preview, the Sketch tool will now be selected.
In Script Editor, save your script as an application somewhere in your home folder.
Find the application you just saved using Finder or Spotlight. Run the application. You will get another error about accessibility access.
Return to System Preferences > Security &amp; Privacy > Privacy.
Click the little plus sign again. Browse to the application you just saved, and add it to the list. Make sure the check box next to it is checked.
Now, run your application from the Finder or Spotlight again. Hopefully you will not get an error this time.
Open Automator. Choose File > New. Choose Service. Under "Service receives selected," choose no input. Click any application and choose Other... Choose Preview.
In the "Actions" search box, type application. Drag Launch Application over to the "Drag actions or files here to build your workflow" panel.
Under Launch Application, choose Other..., then browse to your application.
Save the automator action (Service) with a sensible name, like "Preview Sketch Mode" or something easy to remember that you can type exactly.
Make sure the automator action works.
Launch System Preferences and go to Keyboard. Click Shortcuts. Click App Shortcuts. Click the plus sign. Under Application, choose Preview. Under Menu Title, type the exact name of the service name you saved in step 13 above. Assign a keyboard shortcut to it.


You should now have a keyboard shortcut that enables Sketch mode in Preview.