I would like to create a command that opens the advanced rename dialog and pastes the file names from the clipboard (multiple lines), so I can check what I pasted
I was thinking of something like this but it pastes only the first line in the clipboard to all the selected files.
I don't know, I thought I was doing something wrong, the command already works, but only with one file. With multiple selections and multiple lines in the clipboard it doesn't do what I expected.
You can also use rename preset.
Save as preset named "Clip":
function OnGetNewName(getNewNameData)
{
if (DOpus.GetClipFormat() != 'text')
return
var clipText = DOpus.GetClip('text');
var clipTextArray = clipText.split('\r\n');
var tab = getNewNameData.tab;
var selected = tab.selected;
if (clipTextArray.length < selected.count)
return
var item = getNewNameData.item;
for (i = 0; i < selected.count; i++)
{
if (selected[i] + "" == item + "")
return clipTextArray[i] + item.ext;
}
}
Thank you!!!
Basically it works, the problem arises if there are illegal characters in the clipboard.
With built-in function when I paste it, Dopus corrects them from /\\:*?<>\|"" to ___;#!()_-''
Using the script in some cases generates subfolders
function OnGetNewName(getNewNameData)
{
if (DOpus.GetClipFormat() != 'text')
return
var wld = DOpus.FSUtil.NewWild();
var clipText = wld.EscapeString(DOpus.GetClip('text'), "r");
var clipTextArray = clipText.split('\r\n');
var tab = getNewNameData.tab;
var selected = tab.selected;
if (clipTextArray.length < selected.count)
return
var item = getNewNameData.item;
for (i = 0; i < selected.count; i++)
{
if (selected[i] + "" == item + "")
return clipTextArray[i] + item.ext;
}
}