5

I'm having issues with a simple part of script, where I wanna get the property dock preferences of System Events. I have the following:

tell application "System Events"
    tell appearance preferences
        set ap_prefs to (get the properties)
        set ap_prefs to the properties
    end tell
    set a_pref to the properties of appearance preferences

    -- Error Part
    tell dock preferences
        set d_prefs to (get the properties)
    end tell
    set d_pref to the properties of dock preferences
end tell

In the code above I access appearance preferences in all the ways shown above, but not dock preferences. It give an error error "System Events got an error: AppleEvent handler failed." number -10000.

So what is going on, and why is only giving error with dock? Here @dj_bazzie_wazzie says:

Error -10000…most of the time it is not a target error but an incomplete command or wrong usage of brackets.

But I can't figure out what is the proper way. I've tried all I can think of, also why doesn't it throw the exception for appearance preferences?

Cheers

Community
  • 1
  • 1
user14492
  • 2,116
  • 3
  • 25
  • 44
  • Works fine OMM (10.10.4). What OS are you on (maybe it's buggy on older versions)? Have you applied any non-standard settings/customizations to your dock? – foo Aug 11 '15 at 21:53
  • @foo I'm on 10.10.4 too. I don't recall doing anything to my dock. I also don't have any third party apps that can control the dock. – user14492 Aug 12 '15 at 16:51
  • I expect something's broken in SE then. It's an absolute mess even at the best of times. (Kids, don't design software like this at home!) You could try getting each property of the `dock preferences` object individually, and see if it fails for one or all of them, then [file a bug](https://bugreport.apple.com/) on it (not that I'd hold my breath for a result, if I were you). – foo Aug 12 '15 at 17:11
  • @foo I would have guessed the same but this same error is thrown when I run the command in Script Debugger, which is another IDE for AppleScript. – user14492 Aug 16 '15 at 15:43
  • `s/SE/System Events/g;` – foo Aug 17 '15 at 17:50

1 Answers1

0

This?

tell application "System Events" to get properties of dock preferences
adayzdone
  • 11,120
  • 2
  • 20
  • 37