• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: desktop picture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: desktop picture (From: "Nigel Garvey" <email@hidden>)

  • Prev by Date: Re: similar strings
  • Next by Date: Re: similar strings
  • Previous by thread: Re: desktop picture
  • Next by thread: Re: desktop picture
  • Index(es):
    • Date
    • Thread