Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Possible Fix for Scripting Error' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Possible Fix for Scripting Error
Authored by: JKrahn on Aug 13, '06 04:25:21PM
I was having the same issue. It seems the the GUI scripting doesn't work as expected. I modified the script to use keystrokes rather than GUI scripting and it works just fine. (This may also extend it's ability to older versions of OS X). Let me know how it works for you. I've only posted the changed area, replace it into the existing script.


-- Sets Safari's download location
-- See comment below if the script fails during the setting of the download folder
on set_download_folder(dlFolder)
activate application "Safari"
tell application "System Events" to tell application process "Safari"
keystroke "," using {command down}
tell pop up button 3 of group 1 of group 1 of window "General"
click
keystroke (ASCII character 31) -- down arrow key
keystroke return -- return key
end tell
keystroke "g" using {shift down, command down}
delay 2 -- NOTE: This value should be increased if the new download location doesn't appear in the Go To Folder dialog
tell window "Go To Folder"
set value of text field 1 to dlFolder
click button "Go"
end tell
click button "Select" of sheet 1 of window "General"
click button 1 of window "General"
end tell
end set_download_folder

---
- JKrahn

[ Reply to This | # ]