Play/Pause etc with osascript
-
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
-
@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
-
@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
-
@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
-
@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
-
I found a simple one-line command for pressing space, which is useful for play/pause.
echo "tell application "System Events" to keystroke " "" | osascript