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

Play/Pause etc with osascript

Mac
2
6
2.8k
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.
  • R
    Russ
    last edited by Russ Aug 20, 2020, 1:02 AM Jun 30, 2020, 11:39 PM

    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

    T 1 Reply Last reply Jul 2, 2020, 11:00 AM Reply Quote 0
    • T
      tioinfo @Russ
      last edited by Jul 2, 2020, 11:00 AM

      @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

      R 1 Reply Last reply Jul 2, 2020, 4:44 PM Reply Quote 0
      • R
        Russ @tioinfo
        last edited by Jul 2, 2020, 4:44 PM

        @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

        T 1 Reply Last reply Jul 7, 2020, 6:08 PM Reply Quote 0
        • T
          tioinfo @Russ
          last edited by Jul 7, 2020, 6:08 PM

          @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

          R 1 Reply Last reply Jul 7, 2020, 7:06 PM Reply Quote 0
          • R
            Russ @tioinfo
            last edited by Russ Jul 8, 2020, 1:38 AM Jul 7, 2020, 7:06 PM

            @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

            R 1 Reply Last reply Aug 20, 2020, 1:01 AM Reply Quote 0
            • R
              Russ @Russ
              last edited by Aug 20, 2020, 1:01 AM

              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