Re: Trouble with dock preferences of System Events
Re: Trouble with dock preferences of System Events
- Subject: Re: Trouble with dock preferences of System Events
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 29 Oct 2009 11:15:06 -0700
- Thread-topic: Trouble with dock preferences of System Events
On 10/29/09 3:05 AM, "Axel Luttgens" <email@hidden> wrote:
> Not sure how you concluded that "location" is a relevant property.
> Perhaps a matter of OS version? I'm here with 10.6.1, and "location"
> doesn't appear amongst the dock preferences properties.
Correct. In OS 10.5.8, 'location' appears among the properties of 'dock
preferences'; it's an enumeration that can be bottom, left or right. When
you ask for 'properties of dock preferences', it shows up, as it should in
the properties record as location:bottom (or whatever).
However, when you compile and run Steven's script, or the equivalent
tell application "System Events"
get location of dock preferences
end tell
you get the error he got (Can't get location).
Here's the reason: the raw code for 'location' property of dock preferences
is «property dplo» . But when you type 'location of dock preferences' and
compile, it actually compiles as «class loca», which is another 'location' -
an element of 'network preferences object' class also in the System Events
dictionary.
It's a terminology conflict - a bug, and undoubtedly why the
enumeration/property has been changed in OS 10.6 to 'screen edge'. (I'm not
in 10.6 - for those of you who are, is it the same «property dplo» given a
new keyword? I'm guessing it is.)
For those in 10.5 (Steven), you can make the script work by typing «property
dplo» (you type chevrons via option-\ and shift-option-\) and then Compile.
It will compile to 'location', but any time you edit the script you'll have
to replace it again with «property dplo».
(I worked this out using the "Show Raw (Chevron) Syntax" menu items of View
and Dictionary menus in Script Debugger. It's an invaluable tool to have in
cases like this.)
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden