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

    Play/Pause etc with osascript

    Scheduled Pinned Locked Moved Mac
    6 Posts 2 Posters 4.0k Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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 Offline
                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

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post