firefox - AppleScript - how do I select a menu item in a pop up button that has no title? -


relatively new applescript here...

i'm trying create applescript automate file/save page as... action in firefox. specifically, need select "web page, complete" save as... dialog instead of default "all files" selection in pop button @ bottom of dialog box. (i'm using firefox , option because want save current html contents after javascript code has run - parse out values subsequent processing).

i've been able hack way around problem selecting pop menu (which has no title) using:

((pop buttons of window "save as") description "all files") 

and sending key stroke "w" select "web page, complete" in pop-up menu.

i'm trying find more robust way of doing instead of relying upon fact "w" selects menu item want. tried:

click menu item "web page, complete" of      ((pop buttons of window "save as") description "all files") 

but didn't work. in looking @ accessibility inspector, looks there menu between pop button (drop down list) , menu item can't figure out how refer it.

any appreciated. here's full script:

tell application "firefox" activate delay 0.25      tell application "system events"          tell process "firefox"             set frontmost true              click menu item "save page as…" of menu "file" of menu bar 1             delay 0.25              repeat until window "save as" exists                 delay 0.5             end repeat              click ((pop buttons of window "save as") description "all files")             delay 0.5              -- didn't work:             click menu item "web page, complete" of ((pop buttons of window "save as") description "all files")              -- works because first entry "web page, complete"             keystroke "w"             keystroke return             delay 0.5              set outputfilename "foo3.html" text              keystroke outputfilename             keystroke return              delay 0.5       end tell end tell 

try this

activate application "firefox"  tell application "system events"      tell process "firefox"         set frontmost true         click menu item "save page as…" of menu "file" of menu bar 1         repeat until window "save as" exists             delay 0.2         end repeat          tell window "save as"             tell pop button 1 of group 1                 if value not "web page, complete"                     click                     delay 0.5                     pick menu item "web page, complete" of menu 1                 end if             end tell              set outputfilename "foo3.html"             keystroke outputfilename             click button "save"         end tell     end tell end tell 

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -