I am looking for a command that selects all "FILENAME*.*" from Source to Destination. So it would in my example select all but somethingelse.jpg. (and actually I want to invert that selection in the end because my final goal would be to delete somethingelse.jpg - all files in the destination that dont have a "stub" filename in source). Hope this is understandable. Love all the special selects we already have, but can't see how to do this without a complicated script.
Thank you - does not work though, all files in Destination are selected. Will try to find out why. And found out already - does not work when source filename has special characters (in my case there are () in the filenames). Let me see if I can fix that.
If using wildcards, put a ' (single quote) character before all brackets.
If using regex,. put a \ (backslash) before them. (Remember JScript needs \ to be escaped as well, so it'll usually be a \\ in script code.)
(If using regex, the *.* part in the original script will be wrong, of course. I'm assuming you've changed that. Also note that *.* will only match files with extensions, unlike MS-DOS-style wildcards which would match things with no extension as well. Use just * if you don't require an extension.)
I thing the solution is to use the wild.escapestring method. Just trying to find the right syntax. The input is a list of filenames - so I can't put the escape character in there by fixed positions.
Leo / lpx, I can't find any script samples that use the wild.escapestring method and all the hacks I try do not work. Any idea on how to take the string "item", use the method on it (or create a 2nd scrint) and then use the .name_stem on it?
var w = DOpus.FSUtil.NewWild;
var n = "Example (Name).txt";
var ew = w.EscapeString(n);
DOpus.Output(ew);
var er = w.EscapeString(n, "r");
DOpus.Output(er);
Output:
Example '(Name').txt
Example \(Name\)\.txt
There's another example here (although you don't want the "b" mode in your situation):