1

I'm working with an AppleScript that turns off (but does not quit) Hazel. The script works fine but generates a syntax error.

Here's the part of the code causing the error:

tell application "System Events"
    tell process "System Preferences"
        set frontmost to true
        click radio button "Info" of radio group of window "Hazel"
    end tell
end tell

And here's the error:

System Events got an error: radio button "Info" of radio group of window "Hazel" of process "System Preferences" doesn’t understand the “click” message.

I'm sure there's a simple fix, but I'm new to AppleScript and not much of a programmer. Any help would be greatly appreciated.

1 Answer 1

1

This code works great. Please pay attention to "radio group 1" part. Took me several hours to figure that out. :-/

tell application "System Preferences"
    activate
    set current pane to pane id "com.noodlesoft.Hazel"
end tell
tell application "System Events"
    tell process "System Preferences"
        set frontmost to true
        click radio button "Info" of radio group 1 of window "Hazel"
        delay 1
        click button "Stop Hazel" of group 0 of group 0 of window "Hazel"
    end tell 
end tell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .