Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Get the name of the current desktop image' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Get the name of the current desktop image
Authored by: 6502 on May 10, '06 06:18:29PM

> Is this hint for Tiger only?

I think it will work in earlier OSes, but I haven't tried it in 10.3x.


> I tried this code in Script Editor on my 10.3.9 system and got a
> systax error: "Expected expression, ")", etc. but found
> "property"" and it's been many, many years since I dabbled in
> AppleScript.

System Events should be scriptable in 10.3. You can double check that the property list commands are accessible in your Script Editor application by using the Open Dictionary command -- select System Events.app in the resulting list and you should find an entry for the Property List Suite. If it's there then there's no good reason for the script not to work.

Double-check that your line-breaks are in the right places. The whole thing from "set my_desktop" to the double-parentheses is one line unless you use the Option-Return character () at each line break.


> Do you know if this will display the names of all images on multiple monitors?

It will, but you have to figure out which property list item represents your second desktop picture. In the example, the property list item "1983938400" is the one that holds the location of the desktop picture for the main monitor. You should be able to find the appropriate property list item if you look through the com.apple.desktop.plist file in the Property List Editor (which you may be able to do just by double-clicking the .plist file).

Once you know where to find the entry for the second monitor, it's just a matter of substitution. So let's suppose the plist item containing the name of the second monitor's desktop picture was "552268546" -- you'd add this code to the script...

set my_desktop2 to value of (property list item "LastName" of
property list item "552268546" of property list item "Background"
of property list file ((path to preferences as Unicode text) &
"com.apple.desktop.plist"))

...and then you'd change the last line to...

display dialog (my_desktop & ", " & my_desktop2)



[ Reply to This | # ]
Get the name of the current desktop image
Authored by: JimMueller on May 11, '06 10:43:45AM

> select System Events.app in the resulting list and you should find
> an entry for the Property List Suite. If it's there then there's no
> good reason for the script not to work.

Standard Suite
Text Suite
Accounts Suite
Login Items Suite
Disk-Folder-File Suite
Folder Actions Suite
Power Suite
Process Suite
System Events Suite

Nope - no Property List Suite in 10.3.9

Yet another reason to kick this booger up to Tiger...



[ Reply to This | # ]