use applescript to control app



  • I'm trying to use the applescript to control the app:

    ignoring application responses
    tell application "System Events" to tell process "Flux"
    click menu bar item 1 of menu bar 2
    end tell
    end ignoring
    do shell script "killall System\ Events"
    delay 0.1
    tell application "System Events" to tell process "Flux"
    tell menu bar item 1 of menu bar 2
    click
    click menu item "Disable" of menu 1
    tell menu item 7 of menu 1
    click menu item "for an hour" of menu 1
    end tell
    end tell
    end tell

    But it keeps popping out error saying it can't find the process named "Flux":

    error "System Events got an error: Can’t get menu bar 2 of process "Flux". Invalid index." number -1719 from menu bar 2 of process "Flux"

    Anything that you guys could help me?


Log in to reply
 

Looks like your connection to f.lux forum was lost, please wait while we try to reconnect.