Applescript multiple commands error

applescript

I'm very new to AppleScript and I'm held up in my command to click on a spot in an application. I'm not sure the proper way to tell it to click on the file.

Open App, Click "Football" , Click the checkbox "Enabled"at the top, Then Click "Save" at the bottom

If someone could help with the correct UI. That's as far as I've gotten.

tell application "Lingon X"
activate
delay 5
tell application "System Events"
    tell process "Lingon X"
        click "Football"
        delay 2
        click checkbox "Enabled"
        delay 2
        click button "Save"
    end tell
end tell

end tell

enter image description here

Best Answer

UI Scripting doesn't always work well or that easily.

Try the following example AppleScript code.

tell application "Lingon X"
    activate
    tell application "System Events"
        keystroke 1 using command down
        tell application process "Lingon X"
            tell window 1
                tell splitter group 1
                    click row 1 of group 2 of list 1 of list 1 of scroll area 1 of group 1
                    click checkbox "Enabled"
                    click UI element "Save"
                end tell
            end tell
        end tell
    end tell
    quit
end tell

Note: This ran as coded on my system and took these actions on the first object shown in Lingon X, version 5.1.1 (5110), under macOS 10.12.5. It should work for you too, based on the picture shown in your OP.