Last active
May 4, 2024 02:10
-
-
Save ole/2ddddd45098c1acf0cdc969714ae7156 to your computer and use it in GitHub Desktop.
Assign a keyboard shortcut to the Export Unmodified Originals menu command in Photos.app on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Assigns a keyboard shortcut to the Export Unmodified Originals | |
# menu command in Photos.app on macOS. | |
# @ = Command | |
# ^ = Control | |
# ~ = Option | |
# $ = Shift | |
shortcut='@~^e' | |
# Set shortcut for 1 selected item | |
echo "Setting shortcut for 1 item" | |
defaults write com.apple.Photos NSUserKeyEquivalents -dict-add "Export Unmodified Original For 1 Photo" "$shortcut" | |
defaults write com.apple.Photos NSUserKeyEquivalents -dict-add "Export Unmodified Original For 1 Video" "$shortcut" | |
# Set shortcut for 2-20 selected items | |
objects=(Photos Videos Items) | |
for i in {2..20} | |
do | |
echo "Setting shortcut for $i items" | |
for object in "${objects[@]}" | |
do | |
defaults write com.apple.Photos NSUserKeyEquivalents -dict-add "Export Unmodified Originals For $i $object" "$shortcut" | |
done | |
done | |
# Use this command to verify the result: | |
# defaults read com.apple.Photos NSUserKeyEquivalents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment