OK .. figure it out
... for those who would also like to do this:
Get UI Scripting Beta at <a rel="nofollow" style='text-decoration: none;' href="http://www.apple.com/applescript/GUI/" target="_blank">http://www.apple.com/applescript/GUI/</a>
and Script Editor 2.0 Beta at
<a rel="nofollow" style='text-decoration: none;' href="http://www.apple.com/applescript/script_editor/beta.html" target="_blank">http://www.apple.com/applescript/script_editor/beta.html</a>
Check the "Enable Access for Assistive Devices" in the Universal
Access of System Preferences
here's the code for Script 1
--------------------
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click menu item "Desktop" of menu "View" of menu bar 1
if my wait4window("Desktop") is false then return false
tell window 1
tell pop up button 1
click
tell menu 1
if the name of every menu item contains "Apple Background Images"
then
click menu item "Apple Background Images"
delay 1
end if
end tell
end tell
end tell
end tell
end tell
ignoring application responses
tell application "System Preferences" to quit
end ignoring
on wait4window(this_title)
tell application "System Events"
tell process "System Preferences"
repeat with i from 1 to 60
if the name of window 1 is this_title then return true
delay 1
end repeat
end tell
end tell
return false
end wait4window
--------------------
My cron looks like this
0 9 * * * /Users/spaceman/script1.app > /dev/null 2>&1
0 17 * * * /Users/spaceman/script2.app > /dev/null 2>&1
So at 9am each day the cron fires off script 1 and sets Apple
Background Images folder as the image folder. Then at 17:00 the cron
fires off script2 and sets my other, more exciting pictures as desktop
images.
works like a charm
Roger
(spacemancw) wrote in message ...
> iBook
> OS X 10.2.6
>
> Hi
>
> I want to use applescript to change the desktop pictures on my Mac.
> I have a folder of pics that I want as my random backgrounds at a
> certain time of the day and another folder of pics for the rest of the
> day.
>
> I anticipate running a cron job (with UNIX) that fires off an
> applescript which will set the folder for the background pics ... and
> to set to randomly change every 15 or 30 mins.
>
> ... then the cron will run again and change it back to the other
> folder later in the day.
>
> I can do the cron and the bash script to figure out the time of day
> etc .. I just need to know the syntax for the applescript to change
> desktop background properties.
>
> Thanx
>
> Roger McCarrick
>> Stay informed about: Change the Desktop Background with Applescript