Last login: Sun Oct 9 17:53:49 on ttys000
You have mail.
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
MBP-2021:~ micha$ km1='/Users/michaelschwaiger/Downloads/File1.jpg'; /usr/local/bin/exiftool "-keywords=TESTKEYB" "$km1"
Error: File not found - /Users/micha/Downloads/File1.jpg
0 image files updated
1 files weren't updated due to errors
MBP-2021:~ micha$
I'm a complete beginner unfortunately, what am I doing wrong with the passing?
@noisneil’s macro is setting a Finder Tag whereas you’re trying to write an EXIF tag to the file which as you know are two completely different things.
I’m not sure why you’re using the 3rd party plug in to run your shell script in terminal. You do know that KM has a built-in action to execute shell scripts? It’s documented in the KM wiki here: action:Execute a Shell Script [Keyboard Maestro Wiki]
In addition, there is a huge amount of discussion in this forum regarding running shell scripts so be sure to check that out too. In particular - search this forum for “EXIF” and you’ll get lots of hits.
Thank you very much! In fact, I had checked the forum here once for the task I want to solve (tagging image files with keywords). That's where I got the example from, but couldn't successfully implement it.
I'll have a look at your link and look for more examples.
Sorry for the late reply, but I was on vacation the last few days.
Thanks for your hints, unfortunately I didn't manage to find the right hints for me in the forum, or with the help of the built-in action to execute shell scripts to solve my problem.
I have now copied the files I want to save with the keywords to a temporary directory. If I now run my original script, and use the folder name instead of the file name in each case, it works. Even though this is a roundabout way, this solves my problem. Thank you very much for the time you have taken. Unfortunately I am not a (good) programmer and could not implement your hints.
MBP-2021:~ micha$ km1='/Users/michaelschwaiger/Downloads/File1.jpg'; /usr/local/bin/exiftool "-keywords=TESTKEYB" "$km1"
Error: File not found - /Users/micha/Downloads/File1.jpg
Why is the error reporting a different path to the one you've given it? Why does the prompt show micha in the bit that usually shows the short username while the user home directory (which usually matches the short username) is michaelschwaiger? But for all I know that might be down to the plugin you are using.
Also, the quotes look a bit wrong -- I'd expect the first argument to be -keywords="TESTKEYB".
This would probably be easier to troubleshoot if you uploaded the macro, rather than an image of just a part of it -- and, ideally, one that used the native KM action rather than a plugin. So try posting that if you'd like to avoid the "duplicate then tag" workflow.
Correct, this is an inconsistency as to the username as to the prompt and download directory. I had tried to avoid giving the full name here, hence no screenshot, but I forgot to change the name inside the download path as well. So the return of the script is identical to the original username.
Thanks again for helping me troubleshoot, but I'm happy with my workaround for now. I would like to dig deeper into this though, I still have too many gaps here and would like to work it out.