Boolen Copyto

Discuss and share scripts and script files...
Post Reply
jinny
Posts: 2
Joined: 29 May 2023 01:30

Boolen Copyto

Post by jinny »

Please help!

I am trying to copy files with 2 or more names in them.

Example a file is named "blue cat eats dog in the morning" I want copy it using a script copyto

Code: Select all

copyto "D:\Test", "D:\Folder\*cat* && *dog*";
Doesn't work and returns and error but

Code: Select all

copyto "D:\Test", "D:\Folder\*cat* || *dog*";
Works perfectly but it returns all files named either cats or dogs

I have thousands of image files so i cant do them manually.

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Boolen Copyto

Post by jupe »

copyto doesn't support that method, it supports wildcards only not boolean, if you refer to the help file it documents the possibilities, same with all scripting cmds. Something like this should work though:

copyto "D:\Test", "D:\Folder\*cat*dog*|D:\Folder\*dog*cat*";

Otherwise a better alternative with the power and flexibility of true boolean:

copyto "D:\Test", quicksearch(":cat & dog /fn", "D:\Folder");

I assume you don't want the search to be recursive, else change the /fn to /f

jinny
Posts: 2
Joined: 29 May 2023 01:30

Re: Boolen Copyto

Post by jinny »

They both worked like a charm.

Thank you so much.

What if i have names like "the cat ate the dog but it was for breakfast on sunday" and i need only images that contain cat, dog and breakfast?

What if i also don't need the results to contain "breakfast" and "sunday"? I have some product names like "blue coat with white print" I dont need any result that contains .... white print.

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Boolen Copyto

Post by jupe »

Sorry I don't have time to try and explain the many permutations of boolean syntax to you, some other forum member might be willing, the help file should help if you try reading it. The easiest tip I can give though is to replace & with AND NOT in my previous example, for results you don't want, also keep in mind that you can test your search terms in the find files panel.

kamini03
Posts: 1
Joined: 02 Jul 2023 20:07
Location: argentina
Contact:

Re: Boolen Copyto

Post by kamini03 »

jupe wrote: 29 May 2023 06:02 Sorry I don't have time to try and explain the many permutations of boolean syntax to you, some other forum member might be willing, the help file should help if you try reading it. The easiest tip I can give though is to replace & with AND NOT in my previous example, for results you don't want, also keep in mind that you can test your search terms in the find files panel.
ok sir , thank you

Post Reply