f.lux f.lux forum
    • Recent
    • Popular
    • Register
    • Login

    use applescript to control app

    macOS
    applescript
    1
    1
    2.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      wangxm
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright © 2014 NodeBB Forums | Contributors