ExifTool Forum

ExifTool => Newbies => Topic started by: klemmleuchte on July 09, 2015, 06:29:31 AM

Title: READ Keywords to clipboard
Post by: klemmleuchte on July 09, 2015, 06:29:31 AM
Hello,

sorry, can't find any thread like this:

I need a exiftool-command, which reads IPTC-keywords from file to clipboard, listed in row, separated with commas.

It's to export keywords via clipboard into a input-mask on my photo-portal at ipernity.com.

Any help for me? Thank you!

Best regards, Eike
Title: Re: READ Keywords to clipboard
Post by: Phil Harvey on July 09, 2015, 07:06:29 AM
ExifTool does not deal with the clipboard.  But there may be some other utility you can pipe the exiftool output through.  But to help, I would need to know what system you are using.

- Phil
Title: Re: READ Keywords to clipboard
Post by: klemmleuchte on July 10, 2015, 06:32:30 AM
Thanks for your answer, Phil!

It is a pity that exiftool not communicating with the clipboard.

I'm working with Windows 8.1 x64.

Regards, Eike
Title: Re: READ Keywords to clipboard
Post by: klemmleuchte on July 12, 2015, 06:15:56 AM
Hello Phil,

would you please help, how to pipe the keywords with ExifTool?
Please give advise, which tools you mean for Win8.1.

Thanks, Eike
Title: Re: READ Keywords to clipboard
Post by: StarGeek on July 12, 2015, 01:54:46 PM
Try
exiftool -S -keywords FILE | clip

Title: Re: READ Keywords to clipboard
Post by: klemmleuchte on July 14, 2015, 04:50:20 AM
Thank you!
Tried, but i'm not sure with syntax.

Quoteexiftool -S -keywords {filepath$} | clip

{filepath$} = takes the first marked file in my filemanager

But I don't know how to use 'clip'.

Kann you please help me, StarGeek?
Title: Re: READ Keywords to clipboard
Post by: Hayo Baan on July 14, 2015, 06:54:34 AM
Clip is a windows command line utility that simply takes the input and puts it on the clipboard. In the sample you showed, you are simply "piping" (the |) the output of the exiftool command to clip, so the result will be the output of the exiftool command on the clipboard. Just as you wanted!

Note: errors will not end up on the clipboard, these will still go to the console.

Hope this helps,
Hayo
Title: Re: READ Keywords to clipboard
Post by: klemmleuchte on July 14, 2015, 11:59:33 AM
Thanks Hayo!

Now it works! I don't know, what happened before. I did no changes...

But finally the output is not formatted as I would like. The commata are added to spaces and the row is startet with what it is: "Keywords: ".

Am I able to eliminate "Keywords: " at side of ExifTool or Windows? A little script to handle this?
Title: Re: READ Keywords to clipboard
Post by: ryerman on July 14, 2015, 02:11:54 PM
Use -s3, instead of -S, to remove the tag name from the output.

Use exiftool -p "${keywords;s/, /,/g}" {filepath$} | clip to format the output with only comma separators, not commas and spaces.
s/, /,/g is a PERL expression.
PERL expressions can be used to help format the output when using the -p option.
See the documentation.
Title: Re: READ Keywords to clipboard
Post by: StarGeek on July 14, 2015, 02:23:26 PM
My mistake about -S instead of double checking the correct usage.

And using -sep "," is another option.

For example
exiftool -s3 -sep "," -keywords {filepath$} | clip
Title: Re: READ Keywords to clipboard
Post by: klemmleuchte on July 14, 2015, 05:05:54 PM
OK boys, I have to say thank you. My DOPUS-Button works as should.

You're really great, and i love ExifTool. It's the most helpful tool for me i got in the last years.

BTW I found out, what happened, as the command did not work: It was simple to run the command as MS-DOS Batch and not as DOPUS... :-(

Thank you for your help.

Best regards, Eike