1

I am trying to create a keyboard shortcut action for Preview, namely Draw and Sketch. However, they are are the NON-menued items, which means can't get it done in System Preference I see someone done it from inspiration, it is possible, but when I try to follow alone, here is my code so far and please help me complete this. here are the action. actions

Here is the error I am facing nowenter image description here

after some researches, does the UI/accessibility inspector UI inspector help?

activate application "Preview"
    delay 0.4
set the menuItem to "Draw"
tell application "System Events"
    try
        tell application process "Preview" to click radio button menuItem of radio group 1 of splitter group 1 of window 1
    on error
        try
            tell application process "Preview" to click radio button menuItem of radio group 1 of window 1
        on error errorM

            display dialog errorM

        end try
    end try
end tell
  • Welcome to Ask Different! :) I hope you come to find this site has a lot to offer! In case you haven't already, it's worth taking the time to read the tour. All the best! – Monomeeth Jan 18 at 4:44

You must log in to answer this question.

Browse other questions tagged .