

Note that assigning a global keyboard shortcut can be difficult to not step on a keyboard shortcut of whichever application has focus when the global keyboard shortcut is pressed and also may require adding that application to: System Preferences > Security & Privacy > Privacy
#KEYBOARD SHORTCUT TO SPLIT SCREEN MAC CODE#
The example AppleScript code can be used in an Automator Service/Quick Action using a Run AppleScript action, replacing the default code with it, and assigned a keyboard shortcut in: System Preferences > Keyboard > Shortcuts > Services Tell pop up button 1 of group 1 of window 1Ĭlick menu item "Picture-in-picture" of menu 1Įlse if its value is "Picture-in-picture" then Tell application process "System Preferences" Tell application "System Preferences" to ¬ Repeat while running of application "System Preferences" is true Tell application "System Preferences" to quitĭo shell script "killall 'System Preferences'"

1 Assumes necessary and appropriate setting in System Preferences > Security & Privacy > Privacy have been set/addressed as needed.Įxample AppleScript code: if running of application "System Preferences" then.The example AppleScript code, shown below, was tested under macOS Catalina and macOS Big Sur with Language & Region settings in System Preferences set to English (US) - Primary and worked for me without issue 1.
