I love what you have done Pierre and would like to ask if you help me tweek the script for my needs. I have 3 folders in my desktop list......Apple......iPhoto.....Folders. I have tweeked what you did to open the "Folders" folder. In there I have 5 sub folders....winter, spring, summer, fall, xmas.
Can you help me code it so it selects for example the Fall folder in the "Folders" folder. Thanks.
set screenMode to item 1 of {"Fill Screen", "Fit to Screen", "Center"}
set frequency to item 3 of {"Every 5 seconds", "Every minute", "Every 5 minutes", "Every 15 minutes", "Every 30 minutes", "Every hour"}
tell application "System Preferences"
reveal anchor "DesktopPref" of pane id "com.apple.preference.desktopscreeneffect"
repeat until window "Desktop & Screen Saver" exists
delay 0.1
end repeat
tell application "System Events" to tell window "Desktop & Screen Saver" of process "System Preferences"
tell outline 1 of scroll area 1 of splitter group 1 of group 1 of tab group 1
repeat until (row 1 whose value of static text 1 of group 1 is "Folders") exists
delay 0.1
end repeat
set FoldersRow to row 1 whose value of static text 1 of group 1 is "Folders"
if value of UI element 1 of group 1 of FoldersRow is 0 then
clickUI element 1 of group 1 of FoldersRow-- click disclosure triangle
end if
set EventRow to row 2 whose value of static text 1 of group 2 is "Fall"
if value of UI element 1 of group 1 of EventRow is 0 then
clickUI element 1 of group 1 of EventRow-- click disclosure triangle to open "Folders"
end if
tell application "Finder" to display dialog "stop 1" giving up after 1
--set folderRow4 to row 4 whose value of static text 1 is "Fall"
--set H to item 1 of (get size of row 4) -- height of each row
--set Y0 to item 1 of (get position of row 4) -- vertical position of the first row
--set Y1 to item 1 of (get position of EventRow)
--set Y2 to item 1 of (get position of folderRow2)
--set theEvents to rows ((Y1 - Y0) div H + 2) through ((Y2 - Y0) div H)
--select some item of theEvents
end tell
tell tab group 1
if value of checkbox 1 is 0 then clickcheckbox 1 -- checkbox “Change picture”
if value of checkbox 2 is 0 then click checkbox 2 -- checkbox “Random order”
if value of pop up button 1 is not frequency then
clickpop up button 1
clickmenu itemfrequency of menu 1 of pop up button 1 -- select every 5 min
end if
(*if value of pop up button 2 is not screenMode then
click pop up button 2
click menu item screenMode of menu 1 of pop up button 2 -- picture adjustment
end if*)
end tell
end tell
--quit
end tell