Thursday, October 17, 2019

#1 2019-10-09 04:18:28 pm

MitchBVI
Member
Registered: 2006-02-14
Posts: 153

Change Default Location in Safari for downloads

I know I can change the default download location from preferences but what I would like to be able to do is have a range of locations that I could pick from a list and enter in preferences.

The following script gets me to a point where I need to click Other so as I can make a selection. However I cannot work out how to select other. Needless to say I am still way off entering the new location other than picking it manually, so any suggestions on that would also be appreciated. The problem is at the "click menu item "Other…" (it is entered as an ellipse) and I am told cannot make it into type integer.

Thanks

Applescript:


activate application "Safari"
tell application "System Events"
   tell application process "Safari"
       click menu item "Preferences…" of menu 1 of menu bar item "Safari" of menu bar 1
       delay 2
       click pop up button 2 of group 1 of group 1 of window "General"
       delay 2
       tell window "General"
           --click menu item "Other…"
           click menu item "Other…" of menu 1 of "Desktop"
       end tell
   end tell
end tell

Offline

 

#2 2019-10-10 07:49:53 am

KniazidisR
Member
Registered: 2019-03-03
Posts: 618

Re: Change Default Location in Safari for downloads

Applescript:


tell application "Safari" to activate
tell application "System Events" to tell application process "Safari"
   click menu item "Preferences…" of menu 1 of menu bar item "Safari" of menu bar 1
   repeat until (window "General" exists)
       delay 0.1
   end repeat
   tell window "General" to tell pop up button "File download location:" of group 1 of group 1
       perform action "AXShowMenu"
       click menu item "Other…" of menu 1
   end tell
end tell
tell application "Safari" to activate

Last edited by KniazidisR (2019-10-10 08:01:11 am)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#3 2019-10-10 11:57:03 am

MitchBVI
Member
Registered: 2006-02-14
Posts: 153

Re: Change Default Location in Safari for downloads

Thank you worked perfectly.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)