Thanks a lot. Sorry that sometimes I don't read the docs with enough patience.
What I really trying to accomplish is to recreate the same behavior as described few posts above with 2 differences:
* It should work for copy, not for duplicate
* It should work with incremental affix, not the date one.
That is, you select one or multiple files, then press Ctrl-C and Ctrl-V, and the file will be copied as follows:
Code: Select all
file.user.js => file#2.user.js
file.user.js => file#3.user.js
file.user.js => file#4.user.js
etc
Below is what I have currently.
It works, but not correctly, I will be greatly appreciated for help.
The problem is that I need the incremental affix, not the date one. But it seems that XY doesn't have the variable for it.
Code: Select all
::$affix = <date hhnn>;
foreach($item, <clipboard>, <crlf>, 'e') {
$filename = regexmatches($item, '[^\\]+$');
$exts = regexreplace($item, '^[^\.]+\.?');
copyas $filename . '#' . $affix . '.' . $exts,, $item;
}
In real life, the script is intended to work trough AutoHotkey, and therefore, for convenience, I post AutoHotkey version as well:
Code: Select all
#SingleInstance Force
SetTitleMatchMode 2
XYplorerDir := "C:\PrgFiles\XYplorer"
#If WinActive("ahk_exe XYplorer.exe")
^v::
Run % XYplorerDir . "\XYplorer.exe /script=" . """"
. "::$affix = <date hhnn>;"
. "foreach($item, <clipboard>, <crlf>, 'e') {"
. "$filename = regexmatches($item, '[^\\]+$');"
. "$exts = regexreplace($item, '^[^\.]+\.?');"
. "copyas $filename . '#' . $affix . '.' . $exts,, $item;"
. "}" . """" . A_Space . "/flg=2"
Return