Page 1 of 1
Button to add folder to filename on copy
Posted: 01 Jul 2018 21:58
by jdev21
Would this be possible to do using scripts in XY?
Select a file > Click a button > file is moved to D:\Shared with the old folder name as a new prefix
so C:\coolfiles\a.mp3 would become D:\Shared\coolfiles - a.mp3
Re: Button to add folder to filename on copy
Posted: 01 Jul 2018 22:11
by jupe
The topic says copy, the post says move, but if you really mean
move and if you make sure this this option is enabled:
Configuration | General | Sort and Rename | Rename | Allow move on rename
Then this should work:
Code: Select all
rename "l", "D:\Shared\<curfolder> - <curname>", "p";
It will pop a preview window for you to check if it looks ok, if everything looks ok then you can remove the "p" part if you never want to see a preview.
Re: Button to add folder to filename on copy
Posted: 01 Jul 2018 22:14
by jdev21
I did mean copy rather than move, sorry. Would this be possible without modifying the original file?
Re: Button to add folder to filename on copy
Posted: 01 Jul 2018 22:23
by jupe
This should work, for single files:
Code: Select all
copyitem , "D:\Shared\<curfolder> - <curname>";
Or if you want it to work for multi-selection too:
Code: Select all
copyas "<curfolder> - *.?", "D:\Shared";
The help file is the best place to look for help on the scripting commands.