Okay, looks like I spoke to soon. I'm certain I saw it working with libraries after adding the FSUtil.Resolve command, but now it's not.
I've managed to work around it in a bit of a kludgy way - forcing the tab to go to the 'full' path first so the directory in the location bar changes from "lib://Documents/Test" to "c:\users\myname\Documents\Test":
scriptCmdData.func.command.ClearFiles();
var forceDirChangeForLibraries = "Go {sourcepath$|noterm}";
DOpus.OutputString(forceDirChangeForLibraries);
scriptCmdData.func.command.RunCommand(forceDirChangeForLibraries);
var clip = DOpus.GetClip("text");
var path = DOpus.FSUtil.Resolve(scriptCmdData.func.sourcetab.path);
var splits = clip.split('\n');
for (var i = 0; i < splits.length; i++)
{
var pathAndFileName = path + "\\" + splits[i].replace(/^\s+|\s+$/gm,'');
scriptCmdData.func.command.AddFile(pathAndFileName);
DOpus.OutputString(pathAndFileName);
}
var strCommand = "Select FROMSCRIPT DESELECTNOMATCH";
scriptCmdData.func.command.RunCommand(strCommand);
Works, but not particularly elegant (screen refresh).
Leo - is this one of the cases you were referring to when you said Select FROMSCRIPT can be picky? I'm hopeful that the improvement that's coming will help with my particular situation.
Otherwise, is there a different way I should be going about this? Essentially what I want to be able to do is have a filename (or set of filenames) in the clipboard (with no path information), and have those files selected in the current tab if they are present.
Unfortunately a lot of work I do is in folders that DOpus recognises as in the Documents library, so a solution that works (in a cleaner way than my current script!) would be ideal.
Thanks. 