Do you know "the EXIFtool, a command line utility" is just a wrapper for a 
perl module you can download the source code  for from CPAN?

If you dig down into the perl source code you'll find the regular 
expressions used by EXIFtool to parse XMP file data.  Since BBEdit uses the 
PCRE library for grep searching, whatever regular expressions you find in 
perl code can work with BBEdit (albeit you may have to do some work if 
there are precompiled regular expression variables involved).

Also, EXIFtool can read .XMP files. So, if you have a faster means of 
extracting the metadata from photo files and creating the .XMP files, you 
can use that faster means and still use EXIFtool code on the trimmed down 
metadata only .XMP files.

Also, for your dream script, write a perl script which imports the EXIFtool 
perl module which:

1. For a given input directory, uses the glob function to build a list of 
files of *.XMP files
2. Iterate over the list of XMP files and use the routine(s) from the 
EXIFtool module to extract the desired tags
3. Extract the base file name from the XMP file name you've just extracted 
the tags from and then glob another file list (e.g., base*.JPG, base*.TIFF)
4. Iterate over the file list created in 3 writting out to each file the 
tags extacted from the specific XMP file iteration

As far as scaling concerns goes, that's a lot of files to be writing 
metadata out to the file system on so I don't think you're going to find 
any solution that's very speedy.  As I think you're hinting at, anything 
that involves a manual step per file isn't a viable solution.

>From your follow up postings I see you're trying to find a scripting type 
solution using an automated (scripted?) combination of BBEdit features and 
yet to be determined glue.  However great a development tool BBEdit is, I 
don't think trying for a BBEdit specific solution is a good first choice to 
pursue.  

On Friday, March 13, 2020 at 5:37:02 AM UTC-7, Vlad Ghitulescu wrote:
>
> Hey!
>
> This is a BBEdit-question, but I first need to give a little background to 
> it. :-)
>
 

> [snip]
>
 

> This is not new at all: Google-ing about "*copy IPTC-keywords into 
> Finder-tags*" or viceversa I've found a lot but all of it involved in one 
> step or another the EXIFtool, a command line utility that reads and writes 
> photo-metadata… and this doesn't scale very well (I have A LOT of photos: 
> about 220,000 pics that are more than 2 TB big!) and it is slow, because 
> the EXIFtool have to read the metadata from the photo.
>
 

> [snip]
>
 

> Now finally to my question (sorry for the length!): How could I
>
>    - take each IPTC-keyword (delimited by the tag < rdf:li >, see above) 
>    and 
>    - write this IPTC-keyword into a Finder-tag 
>
> for every photo in a folder?
>
> Ideally I'd have a script, point it to a folder full of photos and BOOM!, 
> after this every photo would have the same Finder-tags as the IPTC-keywords!
>
> Could you please help me with this?
>
> Thanks in advance!
>
> Regards,
> Vlad
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/3784e93c-9613-46b4-af8e-b50ab9deee1c%40googlegroups.com.

Reply via email to