Hello,
1. When I right-click on an empty space in a given folder and choose "open in Terminal", I expect to be able to simply write the desired ExifTool command and it will apply to all files currently in that directory (if I add "-r", it will include sub-directories as well), thus saving time by not having to write the desired path. When I tried to do it, it didn't work and the console said "no file specified". What I'm doing wrong?
2. Does ExifTool work in the Windows PowerShell?
3. What the proper use of quotation marks? Should it encompass both the command and the value ("-usercomment=x") or just the value (-usercomment="x")?
4. Should I always include quotation marks for a given command? (in one way or another, see question 3)
Thanks!
Quote from: Roy Brian on January 15, 2018, 05:14:23 AM
1. When I right-click on an empty space in a given folder and choose "open in Terminal" [...]
I can't help you with this one.
Quote2. Does ExifTool work in the Windows PowerShell?
Yes.
Quote3. What the proper use of quotation marks? Should it encompass both the command and the value ("-usercomment=x") or just the value (-usercomment="x")?
Either should work fine.
Quote4. Should I always include quotation marks for a given command?
You only need quotes if the argument contains special characters (space, greater than, less than, maybe dollar sign and some others). But this depends on the shell you are using.
- Phil
Quote from: Roy Brian on January 15, 2018, 05:14:23 AM
Hello,
1. When I right-click on an empty space in a given folder and choose "open in Terminal", I expect to be able to simply write the desired ExifTool command and it will apply to all files currently in that directory (if I add "-r", it will include sub-directories as well), thus saving time by not having to write the desired path. When I tried to do it, it didn't work and the console said "no file specified". What I'm doing wrong?
Do you really mean Terminal? Are you perhaps on Windows? Do you mean the Command Prompt or PowerShell command line interfaces? If so, are you on Win 7 or something else that is not Win 10, or are you on Windows 10?
In Win 10, I open a command prompt by typing cmd into the search bar, then type cd space and click on the directory window path bar and drag the folder into the cmd window and hit return, which then puts me in the target directory. You could then write your ExifTool command and use a period character . (dot) to specify the current directory. This appears to work exactly the same in Windows PowerShell. I don't wish to mess around with registry hacks or use third party software.
(I use Mac more than Windows, so this may be a bit clunky it would not surprise me if there are easier/better ways)
Hi Stepehen,
Thanks a lot for the reply.
Yes, I was referring to macOS's Terminal.
As I use both Windows and macOS, I'll test your offered Windows solution but I still look forward to having a similar solution for macOS.
Take a look at the 3 attached screenshots from OS X, this should do what you want.
The dot/period . character is cross platform.
Another variation...
Open a standard Terminal window (not from a target folder as in my previous post) and type:
cd and then a space character
Then drag-n-drop the target folder from the Finder into Terminal to populate the target folder, then hit return/enter.
Now type in the ExifTool command with a dot/period character, such as:
exiftool -r .
Screenshot attached.
Quote from: Roy Brian on January 15, 2018, 05:14:23 AM
... thus saving time by not having to write the desired path. When I tried to do it, it didn't work and the console said "no file specified"...
Are you aware of "tab completion" when using the command line on a Mac?
For instance, on my Mac, I can type
~/phothen the tab key which results in
~/photographs/If you know your paths, this can be very quick.
Thanks everyone for the input.
Quote from: Stephen Marsh on January 31, 2018, 05:53:49 PM
Take a look at the 3 attached screenshots from OS X, this should do what you want.
The dot/period . character is cross platform.
Thanks, Stephen! It worked out beautifully. Is there a way to apply the exact same method to a specific file or a bunch of files? That would save me even more typing.
Quote from: Phil Harvey on January 15, 2018, 07:16:22 AM
... But this depends on the shell you are using.
Could you please elaborate on that?
You can drag multiple files into the Terminal window from the Finder... So just type or paste in your favourite ExifTool command into terminal, then drag-n-drop from the Finder and hit return/enter.
A faster method is to make use of the Mac GUI with the power of the ExifTool CLI:
http://prepression.blogspot.com.au/2016/12/automator-diy-exiftool-gui-services.html
Thanks Stephen Marsh, this works really well.
I'm also toying with the idea of leveraging Alfred for these purposes and build some sort of a comfy "GUI" for ExifTool. I need to improve my coding skills first...