when process done do something
Hello There, I have this script to process selected variants then run a javascript, I would like to add logic to it, when process is done then run a javascript, for now i am using the delay but its not ideal sometimes I have many images so the delay is too short or sometimes delay is too long.
tell application "Capture One 21"
tell current document
tell current collection
repeat with theVariant in (variants whose selected is true)
tell theVariant
process theVariant recipe "PSD" -- write the name of the receipe
end tell
end repeat
end tell
end tell
end tell
delay 35 -- wait C1 to finish processing all the images
tell application "Adobe Photoshop 2021"
activate
delay 0.5
do javascript of file "Applications/Adobe Photoshop 2021/Presets/Scripts/myscript.jsx"
end tell
-
Rather than try to play the timing game the better option is to use Capture One's background handlers. Since it looks like only need to know when all images have been processed you can save the second part of your script to its own file and then call:
tell application "Capture One 20"
set batch done script to "location:of:your:script"
end tell1 -
Thanks a lot Emory, That works perfectly! wondering if there is a way to have both of them in the same script file?
0 -
If you're just calling the script from the Scripts menu I don't believe so. Both of those simply call the script without any additional input, so there wouldn't be a way to tell how the script was run.
The only way I can think of would be to use the presence of the expected processed files as an indicator. If there are no files that the JS script needs to act on, process the selected variants. If there are files run the JS script.
1 -
confirming the presence of the processed Variants indicator sound a good option as well, I tried to search about this topic, I am still not sure how to do it.
0
Post ist für Kommentare geschlossen.
Kommentare
4 Kommentare