Hi! I'm trying to make a button that trims the selected images with ImageMagick, copies the timestamps of the source files and pastes them on the new ones with ClipboardEX. This is how my function looks like:
And it works... kinda. It trims all images just fine, but the COPYTIMESTAMPS command only works for the first file. Since, as I understand it, the function runs once per file unless I use the @runonce modifier, this should work.
Am I missing something? Is there a better way to do this? Maybe it's a limitation of ClipboardEx?
Mhh, I'd say this should work.. the FROM/TO params support single/multiple items at once, I checked the code (but did not try yet on my own). Maybe try debugging your button with the Say script command first, you can see in the console whether the parameters you pass get through to the command as you expect them. Say ClipboardEx COPYTIMESTAMPS FROM={filepath} TO={filepath|noext}_trim{file|ext}
ClipboardEx also has XLOG param, to get more output in the console: ClipboardEx <param shere> XLOG=a
I even tried to add other commands at the end like Copy MOVE to make sure it isn't just Opus being weird, and it worked. Looks like lxp is right, I have to parse all the files at once. And I, too, don't know how to list them.
Yeah, maybe I should just do this. I wanted to try ClipboardEX to learn how to use scripts, and exiftool is so much slower than ClipboardEX, but maybe that just makes things more complicated.
I don't know how to use JScript, I tried to modify the default one, but the only thing that I got it to do is to run the ClipboardEx COPYTIMESTAMPS on the first file again and again for each file selected. It's too much time to learn something that I know how to do now with the exiftools suggestion.
If ClipboardEx is executed only once and the previous command multiple times, there's nothing wrong with ClipboardEx. It probably is DO button magic, how it handles calls to script commands compared to how it handles calles to external programs.
If I remember correctly, I created a dedicated UserCommand called "ForEach", which kind of hides a script commands nature to DO and makes them run as usual command, thereby calling them multiple times as expected. Create "ForEach" user command like this:
EDIT: My screenshot does not upload, the forum is "Processing Upload.." forever, so just use my text explanation. You need to enter customize mode and find "Commands" tab in the "Customize" window, create new user command right there. UPDATE: Or see link below in next post for screenshot.
Name: ForEach
Template: CMD/R
Command code:
@nodeselect
&CMD&
Just prefix the line with "ClipboardEx" with "ForEach CMD=..".
Regarding "Say" it's another script command, you need to install before you can use it in DO, find it here:
Yooo, it works, and it looks pretty clean for a "hack". I didn't even know that user commands were a thing. Smart. I'm sure it will be helpful in the future. I got the Say script too.
Thanks!