I might be biting off more than I can chew with this idea, thou I bet dopus can handle it, likely with a script.
my question is...
Can I provide dopus with a filelist.txt, that contains full paths to a list of files, then have dopus copy them to a particular directory?
or has anyone encounterd any other utilities that do a task like this?
I tried to ask chat gpt, thou it rarely provides working scripts, it gave me this... which errors out, naturally.
function OnClick(clickData)
{
var fsu = DOpus.FSUtil;
var sourcePath = clickData.func.sourcetab.path;
var destPath = "C:\\copylist"; // Change this to your desired destination folder
var fileList = fsu.ReadFile("C:\\copylist\\filelist.txt"); // Change this to your text file path
if (fileList.error == 0)
{
var files = fileList.split("\n");
for (var i = 0; i < files.length; i++)
{
var file = files[i].trim();
if (file != "")
{
var fullPath = fsu.Resolve(sourcePath + "\\" + file);
if (fsu.Exists(fullPath))
{
DOpus.FSUtil.Copy(fullPath, destPath);
}
}
}
}
else
{
DOpus.Output("Error reading file list.");
}
}
I'm trying to set this up with inputs.
is there a way to hold onto the var of the first box and get it to the file select box in this case??
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /col create /ansi "{dlgstring|Give this new File Collection a Name.}" /col import "dlgstring" {dlgopen|Pick a text File to Import into the New File Collection|*.txt}
@set TheNewFileCollection={dlgstring|Give this new File Collection a Name.}
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /col create /ansi "{$TheNewFileCollection}" /col import "dlgstring" {dlgopen|Pick a text File to Import into the New File Collection|{$TheNewFileCollection}.txt}
I had to move the lines around a little bit. /create and /import need their own lines.
heres the finished button, working like a dream... I cant be the only that will end up finding this useful.
Create and import into a file collection from a list of files.
@set TheNewFileCollection={dlgstring|Give This New File Collection a Name.}
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /col create /ansi "{$TheNewFileCollection}"
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /col import /ansi "{$TheNewFileCollection}" {dlgopen|Pick A Text File To Import Into "{$TheNewFileCollection}"|*.txt}
and quicker xml for pasting on a toolbar.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>Create && Import a File Collection</label>
<tip>Create & Import A File Collection From Text File Containing A List Of Files</tip>
<icon1>#newcollection</icon1>
<function type="normal">
<instruction>@set TheNewFileCollection={dlgstring|Give This New File Collection a Name.}</instruction>
<instruction>"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /col create /ansi "{$TheNewFileCollection}"</instruction>
<instruction>"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /col import /ansi "{$TheNewFileCollection}" {dlgopen|Pick A Text File To Import Into "{$TheNewFileCollection}"|*.txt}</instruction>
<instruction />
<instruction />
<instruction>// https://resource.dopus.com/t/find-and-copy-file-from-a-filelist-txt/52677/3</instruction>
</function>
</button>
ill keep playing with it. it makes sense that it should work in a slingle link, but maybe have the dialogue box popups were throwing it off? It would create a new collection with the input name. but wouldn't get the filelist.txt from the 2nd, the collection it was crating was empty
@set TheNewFileCollection={dlgstring|Give This New File Collection a Name.}
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /col import /create /ansi "{$TheNewFileCollection}" {dlgopen|Pick A Text File To Import Into "{$TheNewFileCollection}"|*.txt}