• 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: name of the current desktop picture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: name of the current desktop picture


  • Subject: Re: name of the current desktop picture
  • From: John Baltutis <email@hidden>
  • Date: Sun, 11 May 2014 12:20:07 -0700

On 5/11/14, Robert Poland <email@hidden> wrote:
> On May 11, 2014, at 10:33:AM, koenig.yvan <email@hidden> wrote:
>> Le 11/05/2014 à 18:15, Luther Fuller <email@hidden>a écrit :
>>> On May 11, 2014, at 9:23 AM, Robert Poland wrote:
>>>
>>>> I want th find the name of the current desktop picture.
>>>
>>> Do these two lines of code give you anything useful ...
>>>
>>>	tell application "System Events" to (picture of current desktop) as alias
>>>	tell application "Finder" to name of the result
>>>
>>> The only problem I see is that the name is returned with the file extension.
>>
>> Good point Luther.
>> The extension is not a problem as Robert asked for it in its late message
>>(the extension is not available in the GUI).
>> Here is an edited version written because I don't see the need to speakto
>>the Finder.
>> I defined two variables so the full pathname will be already available when
>>Robert will ask for it
>>
>> tell application "System Events"
>>	set backGroundPath to (picture of current desktop) # returns an Unix path
>>	set backGroundName to name of disk item result
>> end tell
>
> Works and avoids the Sandbox issues.

This one-liner works in Snow Leopard and should in later OSs.

tellapplication "System Events"to name of ((picture of current desktop) as
alias)
 _______________________________________________
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


  • Prev by Date: Re: name of the current desktop picture
  • Next by Date: Re: name of the current desktop picture
  • Previous by thread: Re: name of the current desktop picture
  • Next by thread: Re: name of the current desktop picture
  • Index(es):
    • Date
    • Thread