AppleScript used to download subtitle files

applescript

I'm trying to download over 1000 subtitle files for a list of films. I have the list in Microsoft Excel. I found an application called FlixTools that lets you search for a film and then download the subtitles for that film. So far, I have written the following AppleScript:

activate application "Microsoft Excel"
tell application "System Events" to tell process "Microsoft Excel"
    keystroke "c" using command down
    key code 125
end tell
activate application "FlixTools"
tell application "System Events" to tell process "FlixTools" to keystroke "v" using command down
tell application "System Events" to tell process "FlixTools" to click button "Save Subtitle"

Running this code returns an error saying: "Can't get button "Save Subtitle" of process "FlixTools"".

The FlixTools window looks like this:

enter image description here

After clicking on the "Save Subtitle" button on the bottom right, a window appears to save the file:

enter image description here

I'm new to AppleScript, so any help on how to format achieve this would be appreciated.

Best Answer

Use the following example to click the "Save Subtitle" button:

tell application "System Events" to click UI element "Save Subtitle" of group 1 of window 1 of application process "FlixTools"