Script Action
With selected files this script
(1) Calls a rename internal command to add the suffix "SUFFIXX"; and then
(2) Calls a copy internal command to MOVE the file(s) to the destination alias "/work"
What Happens
See screenshot.
Script is executed with a single file selected (File001.png)
(1) rename call successfully adds suffix "SUFFIXX". This can be seen in the screenshot.
(2) copy MOVE call fails with a windows error shown. Windows as you can see is saying that the file cannot find the file filename "File001.png". This is because the file has been renamed.
Questions etc
What is going on? Strange thing is this script used to work.
Maybe some sort of flush operation might help?
Versions and Background
I have tried this with Opus64 12.21 and 12.31.
Reason I tried 12.21 is that it feels like and old issue that I have never gotten to the bottom of detailed here in this link. It seems like the reverse symptom somehow. The issue below did not happen with 12.21. Lister not Refreshing and Explorer Replacement
The script thinks it's still the old name for that is the data and variable it's working with. You need to update the name in the variable or make a new/different one for it, or add the name to the Copy command (adding a FILE argument).
@Ixp thanks. When I do that Opus create a subdirectory in the source folder and move the folder there instead of using the alias as intended. I have looked in the rename notes but I see no clarifying notes. Ideas?
Thanks @Ixp
I got some wierd results with the script see Test 10.
I ran the command via the FAYT prompt as you can see in Test 11 got something different again.
I really appreciate your help and I don't want to burn your time unnecessarily.
Let me retreat, take a break, and then check things out again.
I got help from @Leo a while ago with my Lister not refeshing issue mentioned above and I need to be more sure that it is not my end/my laptop etc. and is causing issues.
The thing that is in front of my mind is that my script has worked for many months/years maybe then started playing up. Symptoms vary alot and do not point in one direction. Below is another example of this. Not making sense at the moment.
Really really appreciate your help.
So let us examine the (Test11/Test12) result.
The intention is to add a suffix.
The use of \1 in the Regular Expression is intended to act as a capture group referencing the original filename.
However this is being interpreted as a literal digit 1 as you can see below.
I tried removing one of the backslashes in the TO expression but no joy..
I think this is solved. See below.
Fix on above is to add a space shown in what color is that? Light turquois?
I dropped it before troubleshooting.
Makes sense that it should be there.
What a mission. Thanks @Ixp - I was hopelessly lost... really really grateful.
Ad 1: Well, that's in Rename's DNA. You can completely change a file's path from Drive to Extension and all folders in between. Even if you only create a subfolder the file already gets not just renamed but moved as well.
Ad 2: Not true in the sense that it's only for external programs? I have never tried to insert a code like {allfilepath} into a rename statement, but it would probably work ...somehow
Just when you thought it safe.
I have something close to a solution above thanks to great help from @Ixp
Question - Is it possible to add the ASK: feature so that the Select Destination Folder dialog, shown below, is brought up?
Or am I finally "asking" too much sorry terrible pun
Gentlemen
I have got your string @Ixp to work in script and FAYT as per below.
Thank you so much I thought I was doomed to fail at the last hurdle!
Now I can fix my script.
My repeats of thank you seem inadequate somehow but I give them anyway!