Running shell scripts in Shortcuts app - can't select "Shortcut input" option

I'm using the MacOS Shortcuts app to create a Finder Quick Action that runs a shell script to run ExifTool. But I can't select the input to my shell script using the Input dropdown. Every time I choose the "Shortcut input" option from the dropdown, it disappears (i.e. doesn't stay selected but resets to blank).


  1. ExifTool is installed and working on my system (via Brew).
  2. Action is set to receive media files Input (Images, media files, PDF) from Quick Actions
  3. The Privacy tab options are set to "allow this shortcut to access Shell", and "Allow Run Shell Script to access Finder"
  4. Next in sequence is the Run Shell Script action. Shell is set to "zsh", Pass Input is set to "as arguments".
  5. The shell script is as follows (calls exiftool on selected files to remove EXIF metadata):
for f in "$@"
     do
         exiftool -all= -overwrite_original "$f"
     done


When I attempt to run the shortcut, I get an error. "command not found: exiftool"

Running "exiftool -all= somefilename.jpg in Terminal works just fine.

un/checking Run as Administrator makes no difference.


See attached image for shortcut setup:

MacBook Pro 14″, macOS 14.5

Posted on Dec 26, 2024 5:49 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 26, 2024 6:10 AM

If your MacBook Pro is Apple Silicon, then homebrew put ExifTool in /opt/homebrew/bin, and if Intel architecture, ExifTool is located in /usr/local/bin. Use the appropriate PATH prefix with ExifTool in your Run Shell Script as it doesn't see the PATH environment variable that you set in ~/.zshrc in the Terminal.

Similar questions

3 replies
Question marked as Top-ranking reply

Dec 26, 2024 6:10 AM in response to matdenney

If your MacBook Pro is Apple Silicon, then homebrew put ExifTool in /opt/homebrew/bin, and if Intel architecture, ExifTool is located in /usr/local/bin. Use the appropriate PATH prefix with ExifTool in your Run Shell Script as it doesn't see the PATH environment variable that you set in ~/.zshrc in the Terminal.

Dec 26, 2024 6:45 AM in response to VikingOSX

Thank you. The exiftool command now runs by hard coding the path to /opt/homebrew/bin/exiftool, but now the error is "Run shell script finished with an error: Error opening file: filepath/filename"

I'm guessing this is because I can't select the Shortcut Input option (which still doesn't "stick" when selecting the option)? Any idea why it won't select? The "clipboard", "current date", "device details", etc options won't stay selected either.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Running shell scripts in Shortcuts app - can't select "Shortcut input" option

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.