Created
May 13, 2017 10:12
-
-
Save cmittendorf/b92bc84a9fd73013423aebe34502dcf1 to your computer and use it in GitHub Desktop.
Copies the location information on macOS from one file to another.
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
#!/usr/bin/env bash | |
if [ $# != 2 ]; then | |
echo `basename $0`" <src file> <dst file>" | |
exit | |
fi | |
xattr -w "com.apple.metadata:kMDItemLatitude" $(mdls -name kMDItemLatitude "$1" | awk '{print $3}' | sed s/\"//g) "$2" | |
xattr -w "com.apple.metadata:kMDItemLongitude" $(mdls -name kMDItemLongitude "$1" | awk '{print $3}' | sed s/\"//g) "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment