Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bingefeller

macrumors 6502a
Original poster
Jun 25, 2007
596
33
Northern Ireland
I have been trying to piece together an AppleScript to save images or videos from imgur.com, but I haven't had much success so far. My knowledge of AppleScript is very basic so the fix is probably something simple.

I figured out the coordinates of where the cursor are when I load a video on imgur. I want to do a right mouse click, save as and then hopefully have the script automatically save it for me when the save dialogue appears.

So far I have this:

AppleScript:
tell application "System Events"
    tell process "Google Chrome"
        click at {725, 550}
        set _selection to value of attribute "AXFocusedUIElement"
        tell _selection to perform action "AXShowMenu"
    end tell
end tell

Which gives me the following error:

AppleScript:
[B]error[/B] "Can’t get action \"AXShowMenu\" of missing value." number -1728 from «[I]class[/I] actT» "AXShowMenu" [B]of[/B] [I]missing value[/I]

As I said, I have no knowledge of AppleScript so I can't figure out the fix is. Any help / troubleshooting would be great!

I'm using AppleScript Version 2.11 (229) AppleScript 2.8.


Screenshot 2023-10-08 at 12.14.40.png


Screenshot 2023-10-08 at 12.15.33.png
 

bogdanw

macrumors 603
Mar 10, 2009
6,118
3,029
I don’t understand what are you trying to automate? Clicking on Save?
How would you trigger the script?
 

bingefeller

macrumors 6502a
Original poster
Jun 25, 2007
596
33
Northern Ireland
I don’t understand what are you trying to automate? Clicking on Save?
How would you trigger the script?

Yes, I am trying to automate having to right mouse click, select save as and then saving the file by pressing the return key / or click on save in the dialog box.

I could maybe assign a shortcut to trigger the script? Is this possible?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.