r/applescript • u/maxihash • Nov 08 '24
Simulate Keyboard press for Play/Pause
I want to simulate the keyboard Play/Pause to stop media from playing at a certain time using AppleScript. I think using the key code 100 will not work, as I found someone explaining this here 3 years ago.
My question is, is there an alternative way to do this in 2024? Do we need a 3rd party app? I found that BetterTouchTool is overkill for this, but I haven’t tried it. Can anyone suggest the best method?
2
Upvotes
View all comments
Show parent comment
1
u/maxihash Nov 09 '24
Yes, it can be any app because the Mac menu bar displays a 'now playing' icon whenever media is being played. Thus, when I manually press the play/pause button, it will work.