Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Applescripting dekstop picture

Applescripting dekstop picture
Thread Tools
Grizzled Veteran
Join Date: Oct 1999
Location: Minneapolis
Status: Offline
Reply With Quote
Nov 11, 2003, 03:44 PM
 
Is there a way to change the desktop picture via applescript? I'm trying to write an app, and can find it no where (finder, system events, etc) set desktop picture to file (file path) Worked in earlier version of OSX, any idea's?
     
Senior User
Join Date: Oct 2000
Location: Midwest
Status: Offline
Reply With Quote
Nov 12, 2003, 08:46 AM
 
Here is an example of one way to set the Desktop to a file in the /Library/Desktop Pictures folder.
Code:
set source_path to path to desktop pictures folder set new_desktop_pic to (choose file default location source_path with prompt "Choose a new picture…" without invisibles) as alias tell application "Finder" set desktop picture to new_desktop_pic end tell
.

You can change the folder intially presented in the choose window by modifying the first line. For instance, change 'path to desktop pictures folder' to 'path to pictures folder'.

HTH
Craig
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:24 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2