News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

What are these called?

Started by terrypin, March 19, 2013, 10:38:13 AM

Previous topic - Next topic

terrypin

I'm making progress but still have several mental blocks. Here's one.



The context is that I'm trying to add 'Folder' or 'Directory' to the GUI Workspace, as an important filed for managing my photo comments. So far I haven't worked out how to do that.

Also, Directory is included under the 'All' tab, so I don't understand why it has no entry?




--
Terry, East Grinstead, UK

Phil Harvey

Hi Terry,

In the list of tag tables, you need to click on "EXIF" to see the EXIF tag names (UserComment, Artist, etc...).  Tags in the "File" group are in the Extra Tags documentation.

If "Directory" is ".", then ExifToolGUI must be changing the current working directory to the selected directory.  ("." represents the current working directory.)  I was afraid of this, because if this is true there will be no way to get the directory name in your output text file via ExifToolGUI.

- Phil

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

terrypin

Hi Phil,

Thanks, understood - duh!

OK, that would rule out the GUI. But is that also true of ExifTool? On that Extra Tags documentation page I found this entry:


Tag Name    Writable    Group Values / Notes
Directory Y! System (may be written to move the file to a specified directory. New directories are created as necessary)


I want to use it to uniquely identify the photo. And write it to ThisPhoto.TXT and ThisFolder.TXT, containing Comment and Date/Time data, for the photo or the folder of them respectively.  So that it can be used to restore those fields when they are subsequently destroyed. I'll spell this out more clearly in a day or so, but that's the general drift.


--
Terry, East Grinstead, UK

Phil Harvey

Hi Terry,

Yes, this will work via the command line.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

terrypin

Thanks Phil, but you're way ahead of me! What exactly will work? Can you give me a simple example to try please?

--
Terry, East Grinstead, UK

Phil Harvey

Maybe something like this is what you want:

exiftool -T -directory -filename -datetimeoriginal -comment -r c:\images > out.txt

(here I use c:\images as an example directory name)

This command will produce a file called out.txt in the current directory.  The file will contain a tab-delimited list of the directory, filename, datetimeoriginal and comment from each image that exiftool finds.  The -r option causes ExifTool to also search sub-directories.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

terrypin

Thanks Phil, but I couldn't get that working.

The first 5 of these which I created earlier as part of my learning, all work as expected. But the last very briefly opens a Command Prompt window, writes some lines, then closes, without creating any output file. Can you see what's wrong please? The folder c:\images contains 11 JPGS, like those I used in my earlier tests.

Name           Windows shortcut
------------   ---------------------------------------
Copy to EXIF   C:\WINDOWS\exiftool.exe -k -o %d%f.exif
Copy to MIE    C:\WINDOWS\exiftool.exe -k -o %d%f.mie
Copy to XMP    C:\WINDOWS\exiftool.exe -k -o %d%f.xmp
Display All    C:\WINDOWS\exiftool.exe -k
Write TXT      C:\WINDOWS\exiftool.exe -a -u -g1 -w txt
From PH - 1    C:\WINDOWS\exiftool.exe -T -directory -filename -datetimeoriginal -comment -r c:\images > out.txt


In case it helps, here's the folder: https://dl.dropbox.com/u/4019461/images.zip

--
Terry, East Grinstead, UK

Tarn

Hi Phil, and Terry

I don't use the GUI that much, so I'm not sure. But in the command line version does the same thing; it shows a dot to represent the current directory. By simply backing up one directory will cause the output to list the directory names, instead of just a dot. But you have to recurse into lower directories for this to work. I'm not sure if the GUI can list files that are in subdirectories or not.

Not sure if this helps you or not.

Tarn

Quote from: terrypin on March 19, 2013, 04:41:28 PM

From PH - 1    C:\WINDOWS\exiftool.exe -T -directory -filename -datetimeoriginal -comment -r c:\images > out.txt
[/code]
Try : > c:\images\out.txt

From PH - 1    C:\WINDOWS\exiftool.exe -T -directory -filename -datetimeoriginal -comment -r > c:\images\out.txt


--
Terry, East Grinstead, UK

terrypin

Hi Tarn,

Thanks, but that alternative failed too.

--
Terry, East Grinstead, UK

Phil Harvey

Hi Terry,

How did you run this command?  It will only work if you type it in a cmd.exe window, in which case the window shouldn't close afterwards.  The redirection to an output file ">" won't work in the Target properties of a shortcut.  If you want to do this with drag-and-drop functionality, it may be done in a .BAT file, but I don't want to overload you with that concept right now.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

terrypin

#11
Hi Phil,

This is the way I really like to learn! I'm now looking forward to solving this little puzzle...  ;)

I've tried it all 3 ways. From what you said I now realise it shouldn't work via drag and drop. But I don't yet see what's preventing it working from either the Run box or Command Prompt. (BTW, should I focus exclusively on the latter? Or should both give identical results?)



Edit: Sorted! 5 minutes later I thought I'd try changing the directory in the Command Prompt before running the command. Something you no doubt thought was obvious, yes? And I'm delighted to find that it worked. Fast and silently too.

It's a while since I wrote any batch files but can you help me find a more robust way of running this command, Phil?

Typically, I'd want to do so with the target folder open. I'd be browsing its photos and adding new comments if necessary or editing those previously made. Carefully avoiding opening it in the dreaded PaintShop Pro, even though sorely tempted because of obvious necessary editing. And as soon as possible I'd want to generate this text output as security against future loss. I could do it if I spend an hour or two writing a macro to effectively emulate all key and mouse activity to do what i've just done. But I'm sure there's a far simpler approach?

I'd also appreciate your briefly explaining why a change of directory was necessary in this case please. The command includes explicit absolute paths. And changing directory wasn't necessary in the earlier examples you gave me. I just opened a Command Prompt as instructed (which always comes up in C:\Documents and Settings\Terry) and pasted or typed the command given.

--
Terry, East Grinstead, UK

Tarn

Terry,

Quote from: terrypin on March 19, 2013, 06:15:34 PM
Hi Tarn,

Thanks, but that alternative failed too.

--
Terry, East Grinstead, UK
Oops! My bad. I overlooked that you don't have a file, or directory specified to work on. Add a file name, a dot ".", an asterisk "*", or a directory name.

exiftool -T -directory -filename -datetimeoriginal -comment -r . > u:\images\out.txt
Works for me.                                                                                         ^

Look at the cut and paste from when I did this. The only difference is I'm working on drive U instead of C.


U:\images>exiftool -T -directory -filename -datetimeoriginal -comment -r > u:\images\out.txt
No file specified

U:\images>exiftool -T -directory -filename -datetimeoriginal -comment -r .
.       a.jpg   -       a.jpg   a.jpg   -
.       b.jpg   -       b.jpg   b.jpg   -
.       c.jpg   -       c.jpg   c.jpg   -
.       image.jpg       2011:07:27 06:56:52     image.jpg       110727-9676.psd -

U:\images>exiftool -T -directory -filename -datetimeoriginal -comment -r . > u:\images\out.txt

U:\images>type out.txt
.       a.jpg   -       a.jpg   a.jpg   -
.       b.jpg   -       b.jpg   b.jpg   -
.       c.jpg   -       c.jpg   c.jpg   -
.       image.jpg       2011:07:27 06:56:52     image.jpg       110727-9676.psd -

U:\images>

If you notice, my first attempt returned the error of "No file specified". That is where adding the dot "." just after the -r option comes in. The dot means all files in the current directory.

The second try, I added the dot, and took out the redirect in order to see the results on the screen. It worked, so I added the redirect back in and it created out.txt. Which I "typed" to the screen.

Hope this helps.

terrypin

Hi Tarn,

Thanks a lot! I'll try your version in a  minute. Looks like our posts crossed in the electrionic ether. As you see from my Edit, I got it working by changing the directory. Not clear why I had to, but that's because I'm not a DOS/Command/Batch/Programmer techie.  ;)

Much appreciate your help.

--
Terry Pinnell, East Grinstead, UK

Tarn

Hi Terry,

I cut my teeth on CP/M (before DOS), so the Dos prompt is familiar to me.
The first thing I would suggest is that you try typing just "Exiftool", without the path and without the dot exe on the end. If you have exiftool.exe in your "C:\Windows" directory, you should be able to call the program from anywhere on your computer.

Next, type "Help" at the dos prompt. This will list all dos commands, and what they do.

You might find it easier to work in your images directory rather than your Documents and settings directory. Type CD \images and press enter, or return. That should take you into the "C:\images" directory. Also, type "CD /?" and it will list all the info on that command.

Batch files, or the most part, are nothing more than typing your commands into a text file that ends in ".bat".  In fact, I'll use your example, as an example.

Create a text file in Notepad, or better yet Notepad++. Type in:
exiftool -T -directory -filename -datetimeoriginal -comment -r . > u:\images\out.txt
and then save it as "out.txt" in either your images directory, or in your windows directory.

Then simply type "out" at the dos prompt and you will see it echoed to the screen and acted on as if you had typed it.

Another tip: The single greater than sign ">" will create out.txt if it does not exist, or overwrite it if it does. Either way, new file every time. Use two gt signs ">>" and it will create out.txt if it does not exist, and append to it if it does.

That should get you going. Remember: "Help" gets you all the commands; any command followed by forward slant question mark "/?" gets you help with that command. Don't let the verbiage scare you, the dos commands are really quit intuitive.

Actually, you should be able to enter all of your lines into one batch file and have them work. Enter each line the same way as my example, on a separate line.  Each command line will execute as soon as the previous one is done processing. If you need it to stop while you look at something, enter "pause" on it's own line, in between the command lines.

This may sound confusing right now. But it really is simple. I just takes a little getting used to is all. You need to make a few mistakes so you can see how not to do it; just as much as you need to get it right. :)

Give a holler if you need more help.