Use of filters

Feeling lazy, and in meetings at the moment and can't concentrate on this too much... so let's see what ya'll think:

Got a static round of files that I need to copy from a particular directory from MULTIPLE network shares to a 'working' directory on the local machine. Right now, they are all specified explicitly on separate Copy command lines in a big-ass button. Not cool to look at, but works.

I initially tried a filter set up with all filenames added as OR items in the filter and 'Use wildcards' turned off like:

Copy FILE \remote1\etc$* TO "D:\gameplan.stage\remote1\conf" FILTER MYFILES

But the problems here are that:

a) sub-folders of the source are "processed" as well - wasting alot of time
b) even in the initial source folder, I believe ALL files are being checked against all of the file names specified in the filter... even if 'Use wildcards' is not selected (don't need them - I'm using full file names).

Any suggestions to streamline this while being able to use a filter? Something with sub-folder, sub-clauses or location match/no match stuff?

A subfolder clause should stop the first problem. (Subfolder, no match: Name match *)

The second thing will always be that way with a filter. Opus has to check whether each file matches the filter, so each file has to be checked. Opus doesn't know that it only has to look for files A B and C if you have a clause that matches (A|B|C); it gets each file and says "does it match (A|B|C)".

To solve the second thing you could try a different approach entirely. Create a user command which copies a named list of files from a source directory to the destination. (i.e. It will have lots of copy lines, one per wanted file.)

If you make the source an argument to the user command you can them make a button on top of it which runs the user command once per source folder.

Will give a whirl with the subfolder clause - thought I had tried that though and saw it no workey... will dbl-check.

About the semantics behind the behavior of the filter logic - yeah makes sense - I was looking at it with tunnel vision based on what I wanted it to do... Wonder if theres a case for evaluating certain criteria of a filter to allow it to be made use of in a faster fashion. There might be limited cases which it would make sense (like this one)... but...

Your user command suggestion makes alot of sense. It gives me a way of consolidating that file list so that as I need to add onto it (or subtract) I can do so only once. Yeah - multiple Copy commands - but that's what I'm having to do now anyway for EVERY network resource - so it's a lot better than my current method...

Cheers! I knew we kept you around for a reason :slight_smile:...

First thing I thought was, "Are you using the right tool for this?" Maybe it's just my background, but I would have written a short script (probably in Python) to do this, and if I did it often enough, I'd assign the script to a button on a DO toolbar somewhere.

Just my .02 dollars' worth.

pt

Interesting... a script eh?

I certainly use my fair share of scripts, but doing so for this sort of task never entered my mind. I think I would re-evaluate my love of Dopus if I had to resort to an external script in order to copy a static list of files :slight_smile:...

But that's your .01 dollar refund :laughing:

Well, 'resort to' isn't the phrase I'd use. I can generally bang out a utility script in Python about as quickly as I can create a button in DO.

I guess my point is that if you're investing time in looking for clever ways to make DO perform a given task, you might find it easier to invest time in doing it in a not-so-clever way in a scripting language like Python, VBS, Ruby, Perl etc.

As you can see from the advanced renaming functionality in DO9, there's definitely a place where DO sensibly stops, and scripting begins.

All the best,

pt

All true... and just personal pref.

For me, copying a static list of files is such a mundane task I wouldn't want to introduce an external dependency like a scripting engine. In fact in this PARTICULAR case, I'll be using the buttons and commands I've set up from multiple stations when the need arises while running Opus from USB... and on such systems won't be allowed to install python or other script engines to do stuff like this... which I didn't consider to be a quest for 'clever' so much as 'concise'. Of course I could always reference an engine from the USB stick as well, but... probably won't until I find I really need to.

Like you, I branch out into scripting for a variety of things... WMI in WSH, VB, batch... etc etc. And JohnZ and Porc have been expounding the virtues of 4nt for awhile now, which I was thinking of checking it out again (been awhile since I last used 4dos from the same company). Thanks for the suggestion PT...