Holding search term

Is it possible to hold the search term entered in top right search field, for a further search in another directory?

I have two large folders (1,000's of files) I usually do searches in, and very often have to do the same search in both (the second immediately after the first search).

It would be more convenient not to have to type in the search term again, as I do this many, many times a day.

If you always search the same two folders, you could make a button or hotkey which asks for the search term and then searches both of them automatically, either joining the results together or saving the results to two separate collections which you can inspect individually.

The Find panel can also search multiple folders at once, without creating a button (although it uses different syntax to the Windows Search field).

Thanks Leo,

I hesitate to ask how this might be done. I know how to add a button, but how to get the relevant commands in might be beyond my basic/non-existent programming skills.

The following button will prompt for a search query and then run it in two folders ("c:\folder one" and "c:\folder two"). You should edit the function to replace those folders with the actual locations you wish to search.

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>My Search</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>@set query {dlgstring|Enter query}</instruction> <instruction>find in &quot;c:\folder one&quot; collname &quot;My Search&quot; clear=yes query {$query}</instruction> <instruction>find in &quot;c:\folder two&quot; collname &quot;My Search&quot; clear=no query {$query}</instruction> </function> </button>

Many thanks Jon for going to all that trouble. Greatly appreciated. I'll give it a go.

Hello Jon,

I can't get this to work. I have copied all of the above and pasted it directly to a toolbar in customize mode.

The button appears ok, and then I edit it by replacing folder one and folder two with full path in each case. Click ok and exit customize mode.

If I click the button the search box comes up ok ("Enter query"); if I enter a search (eg. "filename g9123") I just get a blank right panel.

Jon,

This is how the button looks:

@set query {dlgstring|Enter query}
find in "c:\ZZ_DATA\DATA\OneDrive\Miscellaneous pdfs collname "My Search" clear=yes query {$query}
find in "c:\ZZ_DATA\DATA\OneDrive\Word PG" collname "My Search" clear=no query {$query}

There's a quote missing from the end of the first path.

You may also need quotes around {$query} since you're typing a string that contains a space.

Thanks Leo, but I can't get it to work.

The button now looks like this (but see below):

@set query {dlgstring|Enter query}
find in "c:\ZZ_DATA\DATA\OneDrive\Miscellaneous pdfs" collname "My Search" clear=yes query {"$query"}
find in "c:\ZZ_DATA\DATA\OneDrive\Word_PG" collname "My Search" clear=no query {"$query"}

I have tried "{$query}" also.

Still getting a blank right hand panel.

... and without the quotes at all (around the $query).

Miscellaneous pdfs has sub-directories, Word_PG doesn't.

You shouldn't need the quotes around {$query}.

Have you verified that the search in question actually returns results if you run it manually?

It'd be "{$query}" instead of {"$query"} but in fact I was wrong about needing the quotes. Apologies for that red herring. The QUERY argument is a special type which takes everything that comes after it on the command line, which I didn't realise before.

Try this command, which also simplifies things into a single line (since the IN argument can be given more than one folder):

Find IN "c:\ZZ_DATA\DATA\OneDrive\Miscellaneous pdfs" "c:\ZZ_DATA\DATA\OneDrive\Word_PG" COLLNAME="My Search" CLEAR=yes QUERY {dlgstring|Enter query}

I've checked that and it works here, including finding files in subfolders, and when there's a space in the query string.

Leo,

I still can't get this to work.

Copied and pasted the above into a new button. It wouldn't just paste directly into to menu bar - no paste command with a right click.

The button itself seems ok - it's there and has the command in it.

Run the button and still blank right screen.

Again, have you verified that the query you're running actually returns any results?

Yes, for example I run the same query - filename: county - and it returns 12 results from the single directory. But same query from the button gives a blank right screen.

Which version of Opus are you using?

Can you post a screenshot of the button editor showing how the button is set up?

Version 11.5 x64 Build 5298, 4/7/2014 12:51:02 PM.

How do I upload the image? It won't allow pdfs or docx.

Use an image format, e.g. jpg, png or gif.

Take a screen grab and save the resulting image as JPG or PNG. Saved images can be uploaded and incorporated easily. There is no need to incorporate into a PDF or Word document. Do a search for windows screen capture if you don't know how to do this. There are also some very good screen capture utilities available. Snagit is probably the most widely used.

Regards, AB