• 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: Picture not aways replaced
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Picture not aways replaced


  • Subject: Re: Picture not aways replaced
  • From: Shane Stanley <email@hidden>
  • Date: Mon, 06 Jan 2014 17:45:47 +1100

On 6 Jan 2014, at 4:25 AM, Neil Laubenthal <email@hidden> wrote:

does anybody have one that will tell you the name of the current desktop picture on either the current (or all) spaces?

You could try this; it needs to called from an ASObjC-based script library:

use framework "Foundation"
on spacePicPaths()
set defs to current application's NSUserDefaults's standardUserDefaults()
set theDict to defs's persistentDomainForName:"com.apple.desktop"
set theSpaces to theDict's valueForKeyPath:"Background.spaces."
set allVals to theSpaces's allValues()
set thePaths to allVals's valueForKey:"ImageFilePath"
return thePaths as list
end spacePicPaths

Called via:

use theLib : script "<name of the lib>" 
set thePaths to theLib's spacePicPaths()

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >Picture not aways replaced (From: Robert Poland <email@hidden>)
 >Re: Picture not aways replaced (From: Neil Laubenthal <email@hidden>)

  • Prev by Date: Re: Picture not aways replaced
  • Next by Date: Re: Picture not aways replaced
  • Previous by thread: Re: Picture not aways replaced
  • Next by thread: Re: Picture not aways replaced
  • Index(es):
    • Date
    • Thread