Re: desktop picture
Re: desktop picture
- Subject: Re: desktop picture
- From: kai <email@hidden>
- Date: Thu, 12 Jan 2006 04:26:10 +0000
On 11 Jan 2006, at 23:59, Nigel Garvey wrote:
Is there a reliable way to _get_ the current desktop picture?
tell application "Finder" to get desktop picture
... always returns the same file from my Desktop Pictures collection,
regardless of what's actually on screen. (My system's set up to
choose a
random picture on log-in.)
It's possible to identify a temporary desktop picture - though not
very easily after the settings have been changed manually. Once the
first automatic change has kicked in, something like the following
might work:
----------------------
to getTempDesktopPic()
set pFile to POSIX path of (path to preferences from user domain) &
"com.apple.desktop.plist"
try
tell application "System Events" to tell property list item 1 of
property list item ¬
"Background" of property list file pFile to set filePath to value
of ¬
property list item "ChangePath" & "/" & value of property list
item "LastName"
set fileAlias to POSIX file filePath as alias
display dialog filePath buttons {"Cancel", "Show Me..."} default
button 2
tell application "Finder"
activate
reveal fileAlias
end tell
on error number errorNumber
if errorNumber is not -128 then display dialog ¬
"Data not currently available. Please try again later." buttons
{"Cancel"} default button 1
end try
end getTempDesktopPic
getTempDesktopPic()
----------------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden