Catalog - add current search as script. How to quicksearch(?) to search in contents

Features wanted...
Post Reply
Julian
Posts: 48
Joined: 16 Dec 2022 08:24

Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by Julian »

I think it would be praktical to have a button near "Jetzt Suchen" which automativally creates an item in the catalog which performs the search from a script.

Maybe it can first prompt for a suitable name for this script item and an icon?
Last edited by Julian on 31 Dec 2022 10:38, edited 1 time in total.

Julian
Posts: 48
Joined: 16 Dec 2022 08:24

Re: Catalog - add current search as script

Post by Julian »

I now fould that using the QuickSearch I can get what I need.

I.e. I create a catalog entry which runs this quick script: ?ageM:<= 30 d /flatfiles

Julian
Posts: 48
Joined: 16 Dec 2022 08:24

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by Julian »

I tried to improve this to search for (binary) contents in the current view (and optional subfolders)

I came up with this quickscript

Code: Select all

::$T=input("Suche nach Text");quicksearch("contentflags=b/contents="+$T)
That does nothing visible since quicksearch is returning a set of files which I can display in in a text() box - which is not what I need.

Which scriopt command has to be used to launch a search just like the search box?

--> It would be useful if the search box could create a script - mabye even with a placeholder as input() dialog.

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by highend »

To use the search gui? loadsearch() but this would require a search template (that you're saved before or create on the fly) which you would need to do via scripting.

Just getting the search results in a pane? paperfolder()
One of my scripts helped you out? Please donate via Paypal

Julian
Posts: 48
Joined: 16 Dec 2022 08:24

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by Julian »

Thank You!

I tried this

Code: Select all

::$T=input("Suche nach Text");$files=quicksearch("contentflags=b/contents="+$T);paperfolder("Ergebnis",$files,,n)
This does not work, unfortunately. (it does not know paperfolder)

Of course I can press and F3 and then type in
* /contflags=b/contents=sometext

or use #266 in my script to open the quickfind.

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by highend »

What does that mean, it doesn't know paperfolder?

The only thing you're doing here, is creating one, not loading it into the pane...
One of my scripts helped you out? Please donate via Paypal

Julian
Posts: 48
Joined: 16 Dec 2022 08:24

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by Julian »

The last time I got the message paperfolder() was not known as script command.

I modified my script to the one below and it works! Thanks for the hint to explore the concept paperfolder.
(I still think this is too complicated and should be created automatically.)

This script searches from current location in binary mode and opens a pane with the result (I hope)

Code: Select all

::$T=input("Find any text");$files=quicksearch("contentflags=b/contents="+$T);paperfolder("SearchResult",$files,,n); goto(paper:SearchResult)

Julian
Posts: 48
Joined: 16 Dec 2022 08:24

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by Julian »

After playing with the options I decided to create a specialized program for this task. It integrates within XY - read more here: viewtopic.php?t=25645

WirlyWirly
Posts: 195
Joined: 21 Oct 2020 23:33
Location: Through the Looking-Glass

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by WirlyWirly »

I too would like to have a flag for the quicksearch() function that triggers the provided expression as if it were entered into the GUI.

The problem with passing the return of quicksearch() as an argument to paperfolder() is that inconsistencies between a GUI quick search and paper folder.

Depending on your settings, the view could be very different between a quick search and a paper folder, you have to do a hard-delete (shift+delete) to actually affect the file in a paper folder, and refreshing the tab would normally clear a quick search but it doesn't do much for a paper folder. There's also the fact that paperfolder() creates a file in the <xypaper> directory, which isn't desirable whenever one makes a search.

Only searches performed by the FindFiles tab are saveable and therefore callable by loadsearch(). If the function could accept a raw-template instead of a template name then that would be more flexible.

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

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by jupe »

When you perform a quicksearch via GUI, do you take note of the path in the address bar? you can use that with SC goto.

WirlyWirly
Posts: 195
Joined: 21 Oct 2020 23:33
Location: Through the Looking-Glass

Re: Catalog - add current search as script. How to quicksearch(?) to search in contents

Post by WirlyWirly »

Actually no I never noticed, I've never used the address bar and so its always been removed.

Images not named 'cover'|goto "?>^cover\. /i /excl=Graphics\ /types={:image} //Images not named 'cover'"|<xyicons>\filetypes\image.ico

That worked perfect, seems to replicate the GUI function exactly, thanks a bunch :biggrin:

Post Reply