6/24/2023 0 Comments Exiftool mac os xIn the Terminal it will simply output ” No such xattr: :kMDItemWhereFroms.īut in a Automator Service, it stops the Workflow, so we direct the error message into a black hole which is: 2> /dev/null so the service can continue regardless. Line 4-6: 2> /dev/null when an extended attribute like :kMDItemWhereFroms is not present, it will stop the Difference here is we are using the path to the binary Line 3: /usr/local/bin/exiftool -overwrite_original -all= "$f"Īs in the first script it tells where to look for the exiftool tool. Xattr -d :kMDItemDownloadedDate "$f" 2> /dev/null Xattr -d :kMDItemWhereFroms "$f" 2> /dev/null Xattr -d :_kMDItemUserTags "$f" 2> /dev/null Copy Paste this into the action text box (remove existing code in the text box, and change PATH if necessary):įor f in -overwrite_original -all= "$f".Here we use xattr instead of the ”Tag” tool. The "*" "$f" means all file types and the file(s) choosen. The tag -r removes all Finder Tags and Labels. The at the end indicates when the command is finished, go ahead and jump to the next command. The $f is telling the command what file(s) it's working with. Removes all Metadata for Exif and so on and overwrites the original file (be careful!). Line 4: exiftool -overwrite_original -all= "$f" This may not be necessary depending to your enviroment settings. Tells where to look for the exiftool and tag tools. Line 1: PATH=/usr/local/bin:/bin export PATH Test it by selcting a file with metadata (Finder Tags, Finder Labels, Camera Metadata, GPS Data, Spotlight Comments and so on) in the Finder and Right-ClickĪnd go to end at the Context menu labeled ”Services” and look for the name you gave your Service. Save the Service into /Users/yourusername/Library/Services. Copy Paste this into the action text box (remove existing code in the text box, and change PATH to /usr/local/bin/exiftool if you want):įor f in -overwrite_original -all= "$f" tag -r "*" "$f".At the right in the Run Shell Script action, change the Pass input from to stdin to as arguments.Drag the Run Shell Script action to the ”canvas” on the right side.In the sidebar to the left, search for Run Shell Script.In the text field for the Set Spotlight Comments for Finder Item action, add one single space (for some reason, if left empty, it will not work for what we are doing).Drag the Set Spotlight Comments for Finder Item action to the ”canvas” on the right side.In the sidebar to the left, search for Set Spotlight Comments for Finder Items.In the Services receives selected: menu at the top of the ”Canvas” on the right, change to files and folders and ”in” to Finder.app.Choose ”Service” in the dialog sheet when creating a new document.Open up Automator.app located in your Applications folder.Short version: /usr/bin/ruby -e "$(curl -fsSL )" Install Tag by copy paste: brew install tag.Install ExifTool by copy paste: brew install exiftool.Follow the instructions at to install Homebrew in a snap.Open up your Terminal.app (or iTerm.app).For installing Xcode and Command Line Tools.macOS/Mac OS X (tested only on El Capitan, but should work on Sierra and older versions).
0 Comments
Leave a Reply. |