I'm trying to make a Python script, I can get variables from Core and calculate them.
But how to get them updated back to Core? For example I'm passing a number by FFwfdoc.Keywords and how to update it back from Python to Core?
Solved! Go to Solution.
At this moment you cannot update the variable. What you can do however is to create a MAX file on the fly with the variable calculated. As an example the attached script, that you will need to run on a hotfolder, will get the keyword from the pdf as an integer, multiply the keyword by two and create a MAX file that is sent to and picked up by FFCore.
If a pdf named test.pdf is submitted to the hotfolder and if its contains the keyword 123, the resulting MAX file will contain:
You alse need to use the MAX Setup on the hotfolder and set the file to be picked up from column A and the custom variable from column B and select ; as separator. If you set the name of the variable for column B to for instance calculatedkeyword you can then use it as a variable in a workflow by using $FFcalculatedkeyword$
Everything greate but im submitting file by hotfolder passing PDF and I want to change the value of Quantity (for Print node in next step). By default it is set it to 1, I want to change it by calculating in External. Then I can save MAX with calculated quantity by this script?
Using the script I first sent you can add column B as the Standard Field Quantity in the MAX Setup on the hotfolder.
If you wish to do this in an External Process instead you can before printing the job insert Save and an External Process.
"$FFin$" "$FFout$" "$FFxpf$" "$FFwfJob.jobName$" "$FFwfdoc.Keywords$"
The Python script will set "$FFwfdoc.Keywords$" to the number of copies in the XPIF.
You can update the XPIF by using the $FFxpf$ variable. As the job is printed then either XPIF will be used for Xerox printers or it will be converted to JDF for supported non-Xerox printers.