Page 2 of 2

Re: Add data to the description metadata of a pdf

Posted: Thu Aug 05, 2021 8:48 am
by JimmyHartington
magnussandstrom wrote: Tue Aug 03, 2021 9:17 am I would love an example flow!
Hi Magnus

Here is an example flow. https://d.pr/f/spNLtk+

In my flows orange folders add private data. Dark blue are external folders.
I have included the .cmd file I made for EXIF tool in the zip. I am not sure if I need to add my script package. But if it is missing, then write back.

In this demo all the input folders (A, B and C) has add hierachy info set to yes. The Add Private Data folder adds a string of the metadata I need. So it is here that needs to be changed for other uses. I append the XMP Description here as well.
Write XML writes a XML-file in the format EXIF tool needs. This is then sorted out in its own folder, so I know where it is in for the .cmd program.
The .cmd program executes the EXIF tool command for adding the XMP Description, and then deletes the XML-file.

If somebody has a better idea for doing this I would like to hear. Especially about the dark blue external folder. If I could avoid this to make the flow a bit more simple it would be nice.

Image

Re: Add data to the description metadata of a pdf

Posted: Thu Aug 05, 2021 9:15 am
by Padawan
Some idea's to optimize it:
- Adjust the code of the "Write XML" script to store the text as dataset to the job + store the path to the dataset as private data
- Then use private data containing the path in the Execute Command

(Did not test this, but I think it should work)

Re: Add data to the description metadata of a pdf

Posted: Thu Aug 05, 2021 9:56 am
by jan_suhr
For those who don't have the Scripting Module they can use the Make XML app instead to create the XML

Re: Add data to the description metadata of a pdf

Posted: Thu Aug 05, 2021 1:37 pm
by JimmyHartington
Padawan wrote: Thu Aug 05, 2021 9:15 am - Then use private data containing the path in the Execute Command
How would you in a commandline access the path to the private data?

Re: Add data to the description metadata of a pdf

Posted: Thu Aug 05, 2021 3:10 pm
by Padawan
If the path tot the dataset is stored in private data, then you can access it in execute command using a variable:
[Job.PrivateData:Key="PrivateDataFieldContainingPath"]

Re: Add data to the description metadata of a pdf

Posted: Thu Aug 05, 2021 3:43 pm
by Padawan
I've created a flow with minimal scripting which does this:
z-Demo of processing info updated.sflow.zip
(14.89 KiB) Downloaded 317 times
- Create an XML dataset using the "Create Log" app
- Store the path to the dataset as private data using "Data Mapper" and a small script expression:
var ds = job.getDataset("Xml");
var dsPath = ds.getPath();
dsPath;
- Use the path in the exiftool command via "Run Command"

Re: Add data to the description metadata of a pdf

Posted: Fri Aug 06, 2021 10:04 am
by JimmyHartington
jan_suhr wrote: Thu Aug 05, 2021 9:56 am For those who don't have the Scripting Module they can use the Make XML app instead to create the XML
It should also be possible to use the free app Create text file.
https://www.enfocus.com/en/appstore/pro ... -text-file

Re: Add data to the description metadata of a pdf

Posted: Fri Aug 06, 2021 10:04 am
by JimmyHartington
Padawan wrote: Thu Aug 05, 2021 3:43 pm I've created a flow with minimal scripting which does this:
z-Demo of processing info updated.sflow.zip
Thanks. Will look at this when I get some more time.