Redirect Progress (-progress) to the Title Bar?

Started by georgejones314, August 05, 2016, 05:10:42 PM

Previous topic - Next topic

georgejones314

Is is possible to show the progress (-progress) as the filename in the title bar in a command window? The DOS command is TITLE.

If not, can you consider this as a feature request?

Thx
G

Phil Harvey

Interesting idea.  I'll look into this.

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

georgejones314

If you decide to go all out, here's the link to the website that shows how to do this robustly in DOS Batch: http://www.dostips.com/?t=Batch.Progress
I've attached a jpeg of how this looks when implemented.
G

Phil Harvey

I've looked into this and it is doable on Windows, Mac and Linux.

You say you want the file name in the title?  What about the percentage complete?

I would like to avoid adding a new option if possible.  Could this maybe be an extension of the -progress option?

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

Phil Harvey

#4
I think I have a good solution.  How is this?:

       -progress[:[TITLE]]
            Show file progress count in messages.  The progress count appears
            in brackets after the name of each processed file, and gives the
            current file number and the total number of files to be processed.
            Implies the -v0 option, which prints the name of each processed
            file when writing.  When combined with the -if option, the total
            count includes all files before the condition is applied, but
            files that fail the condition will not have their names printed.

            If followed by a colon (ie. -progress:), the console window title
            is set according to the specified TITLE string.  If no TITLE is
            given, a default TITLE string of "ExifTool %p%%" is assumed. In
            this string, %f represents the file name, %p is the progress as a
            percent, %r is the progress as a ratio, and %% is a % character.
            May be combined with the normal -progress option to also show the
            progress count in console messages.

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

StarGeek

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

georgejones314

Looks good to me. Thanks for considering this as a development idea.

BTW, another suggestion for the forum 'tag line' (instead of Metadata R Us) could be 'I never Metadata I didn't like', or something similar.

G

Phil Harvey

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

georgejones314

Thanks for the new progress title bar feature. The %f option (in batch %%f) throws off errors for filenames containing ampersands (&) ... I tried several tricks to get around this, but no joy.

Rgds

Phil Harvey

#9
Right, thanks.  It is my mistake for not quoting the string sent to the "title" command.  This will be fixed in the next release.

- Phil

Edit:  No, wait.  There is a reason I didn't quote the string:  The quotes show up in the window title. :(

This will be trickier than I thought...


Edit2: OK, I've got a solution.  Individual characters in a Windows command may be escaped with a carat (^).  This is new to me, and it solves the problem.  ExifTool 10.27 will implement this fix.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Hayo Baan

While you're fixing things ;D: the window title now stays at the last setting when exiftool got interrupted (e.g., when the user pressed CTRL-C). It would be nicer if the window title got reset in this case.
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Ah, right.  Thanks for the report Hayo.  I'll fix this too in 10.27.

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

Phil Harvey

Hey.  I like this feature.

For each ExifTool release I have a test suite of about 10000 files that I run ExifTool on -- a process that takes a few minutes.  Adding the -progress: option to this command is very useful.

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

Hayo Baan

Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

The fixed version is out now.

Note there is also an undocumented %b progress bar feature (eg. -progress:%40b shows a 40-character progress bar in the title.  The bar is 20 characters wide unless another width is specified.).  I haven't documented this because I'm not sure I like it, or maybe there is a better way to implement this (ie. better characters than "I" and ".").  If anyone has an opinion about this, I'm all ears.

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