• 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: change desktop wallpaper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: change desktop wallpaper


  • Subject: Re: change desktop wallpaper
  • From: Julian Flach <email@hidden>
  • Date: Mon, 26 May 2008 18:55:59 +0200

Hi,

I've taken this one

set desktop picture to file "Macintosh HD:Users:test.jpg"

and it works! The others result in the same error, that the file doesn't exist... doesn't matter. I've one which I can use... :)

Thank you for your help!

Julian

Am 26.05.2008 um 18:44 schrieb Ed Stockly:

Try this:

tell application "Finder"
   set desktop picture to "Macintosh HD:Users:test.jpg"  as alias
end tell

With the {} you're trying to coerce a list into an alias, which doesn't always work.

You may also try any of these:

   set desktop picture to alias "Macintosh HD:Users:test.jpg"
   set desktop picture to file "Macintosh HD:Users:test.jpg"
   set myDesktopPhoto to  "Macintosh HD:Users:test.jpg"  as alias
   set desktop picture to myDesktopPhoto
   set desktop picture to item 1 of{"Macintosh HD:Users:test.jpg" } as alias

This one is my favorite:

   set desktop picture to alias "Macintosh HD:Users:test.jpg"


because it requires the file to be there when you compile the script, which, in this case, may mean fewer runtime surprises.

HTH

Ed

Hi everbody,

I try to make a little script, which changes my desktop wallpaper, but I've a problem...

I have the following piece of code:

tell application "Finder"
   set desktop picture to {"Macintosh HD:Users:test.jpg"} as alias
end tell

But wenn I execute the code, I get the message: ' Couldn't find the file "Macintosh HD:Users:test.jpg" '. But the file exists at these place, because if I write



Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
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: 
 >change desktop wallpaper (From: Julian Flach <email@hidden>)
 >Re: change desktop wallpaper (From: Ed Stockly <email@hidden>)

  • Prev by Date: Re: change desktop wallpaper
  • Next by Date: Re: change desktop wallpaper
  • Previous by thread: Re: change desktop wallpaper
  • Next by thread: Selecting Last X Lines of Shell Script Result
  • Index(es):
    • Date
    • Thread