Control playback on Mac OS via iOS shortcuts

I want to share a fairly simple, but as time has shown, a useful way to control playback on macOS from quick commands (for example, iOS), without additional client-server applications. Management is done by calling a python script via ssh. Library used to simulate pressing media keys pyobjc-framework-Quartz.

Tested on MacOS 10.15.7 and MacOS 12.6.4.

Procedure:

1) Install the library:

pip3 install pyobjc-framework-Quartz

2) Clone repository with the control script to your home directory (if you clone to another, do not forget to change the path to the script file in the quick command):

git clone https://github.com/guinmoon/ios-macos-mediakey-shortcuts ~/ios_macos_mediakey_shortcuts

3) Allow SSH access to Mac:

4) Add quick commands from repository per device:

When adding a command, you will be prompted to enter an ip address, username and password to access the Mac via ssh:

Conclusion

I often use this method of playback control, as it avoids the need to run additional software in the background, and ssh access is used for other tasks.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *