I have a button defined to unzip a file to the destination and then delete the original zip file. It has generally worked okay, but today I noticed a problem when I launched a couple additional unzip tasks at the same time. It appears that Opus is deleting whatever file/directory happens to be selected at the time it gets to the delete step rather than deleting the originally selected zip file. The script for the button is as follows:
Is there some way to capture the currently selected file(s) for later use with the Delete command so it won't delete the wrong file if I move to a different directory while a large file is being unzipped?
I haven't had time to work out the exact commands, and tonight's looking like it's going to be busy, but you should be able to do this by including the selected filenames in the commands.
In Opus 8 this will probably also require that the two commands are run via dopusrt so that the argument codes work.
(In Opus 9 the argument codes work with all internal commands so the button would be simpler.)
But I haven't tested this at all and may have it wrong! I figured the general gist of the solution might give you something to work with even if I don't have time to work out the exact answer.
I just tried that but it appears to almost simultaneously spawn both commands. The delete command fails because the copy command still has the file open. Is there some way to delay the execution of the commands so the delete doesn't start until the copy has completed?
I forgot that dopusrt doesn't wait for the commands to finish, sorry.
This works better:
@nodeselect
Copy EXTRACT=sub HERE
sync: dopusrt /cmd Delete QUIET NORECYCLE SECURE=1 FILE {filepath$}
There's still a problem, though. All of the deletes happen in parallel which isn't ideal in combination with the SECURE option.
I can't think of a better way that works with Opus 8, though, sorry.