On 19 Jul 2013, at 13:42, Brian Christmas < email@hidden> wrote: I haven't followed this thread, but this will get you the properties of the desktops.
tell application "System Events" set temp to id of every desktop as list repeat with x from 1 to count of temp set tempID to item x of temp as integer get the properties of desktop id (tempID) end repeat end tell _______________________________________________
Well, there's an interesting thing. This didn't work on my machine with an external display, returning an error. I tried it several times. A little later, I decided to see if it'd work without only one display, which it did. Now here's the magic part: when I plugged in the external monitor again, it now worked with both!!
One thing worth mentioning here, though: if you look at the 'Result', you'll only see one set of properties (the result of more than one record with the same properties will do that to you). To see the properties for both (or more) displays, you need to look in the 'Replies' panel.
BTW, in playing around with this, I ended up with a routine that returns the value of any property. Try altering the values of i and j (explanation in the script). It's a long winded way of doing what you could do in a couple of lines if you already knew what you're looking for, but it could be adapted to get info from a user.
on _getProps(theList, someProperty) get item someProperty of theList end _getProps
tell application "System Events" set nn to count of every desktop set n to 1 set x to {} as list repeat while n is less than or equal to nn
set x to x & properties of desktop n as list set n to n + 1 end repeat end tell
(* Play with different setting for i below between 1 and 10, where
1 = display name; 2=id; 3= changer interval; 4= name; 5=picture; 6=class; 7=filepath; 8=tranlucentmenubar; 9= random order; 10=picture rotation *)
set i to 3 -- get user choice in display dialog or choose from list?
(* play with different setting for j below where 1 is desktop 1, 2 is desktop 2 etc *) set j to 1 -- 1 is Desktop or Display 1, 2 is Display 2, etc
--------------------- if j is greater than nn then display dialog "You don't have " & j & " displays connected!" else if j = 1 then set i to i else set i to i + ((j - 1) * 10) end if set p to i _getProps(x, p)
Best
Phil
|