• 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: Ed Stockly <email@hidden>
  • Date: Mon, 26 May 2008 09:44:36 -0700

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


_______________________________________________
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
  • Follow-Ups:
    • Re: change desktop wallpaper
      • From: Julian Flach <email@hidden>
References: 
 >change desktop wallpaper (From: Julian Flach <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: Re: change desktop wallpaper
  • Index(es):
    • Date
    • Thread