TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Play/Pause etc with osascript

    Mac
    2
    6
    2.6k
    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.
    • RussR
      Russ
      last edited by Russ

      AppleScript can do all sorts of things on a mac. osascript is a built-in tool to run AppleScript.

      This page is a good document to get started: https://ss64.com/osx/osascript.html

      Examples:
      osascript -e 'tell application "iTunes" to play'
      osascript -e 'tell application "Music" to play' (on Catalina+)
      osascript -e 'tell application "iTunes" to pause'
      osascript -e 'tell application "Music" to pause' (on Catalina+)

      EDIT: I found a simple one-line command for pressing space, which is useful for play/pause.

      echo "tell application "System Events" to keystroke " "" | osascript
      

      Russell VanderMey

      tioinfoT 1 Reply Last reply Reply Quote 0
      • tioinfoT
        tioinfo @Russ
        last edited by

        @Russ GOOD MORNING and that I have a youtube channel in Brazil and the subscribers are asking for a video on how to open the trigger app more on the mac and I'm not getting it can help me

        RussR 1 Reply Last reply Reply Quote 0
        • RussR
          Russ @tioinfo
          last edited by

          @tioinfo, do you want me to make a video about how to install the TRIGGERcnd agent on a mac?

          Or about how to open mac apps with TRIGGERcmd?

          In general, to open one of the apps in the Applications folder, it's:

          open -a Calculator
          

          Russell VanderMey

          tioinfoT 1 Reply Last reply Reply Quote 0
          • tioinfoT
            tioinfo @Russ
            last edited by

            @Russ Hello there would be how to make a video or show me how to execute programs by trigger on mac, programs like final cut, photoshop because there is a lot of demand but very little content for mac in the trigger

            RussR 1 Reply Last reply Reply Quote 0
            • RussR
              Russ @tioinfo
              last edited by Russ

              @tioinfo, yes, I'll make a video for mac users hopefully later today. I'll show how to figure out the command to launch mac apps.

              EDIT: Here's the video: https://youtu.be/Sda3vM1cXQI

              Russell VanderMey

              RussR 1 Reply Last reply Reply Quote 0
              • RussR
                Russ @Russ
                last edited by

                I found a simple one-line command for pressing space, which is useful for play/pause.

                echo "tell application "System Events" to keystroke " "" | osascript

                Russell VanderMey

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post