Page 1 of 1
Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 16 Dec 2022 08:31
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?
Re: Catalog - add current search as script
Posted: 19 Dec 2022 14:38
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
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 31 Dec 2022 10:45
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.
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 31 Dec 2022 10:55
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()
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 31 Dec 2022 14:58
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.
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 01 Jan 2023 19:25
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...
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 02 Jan 2023 06:13
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)
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 08 Jan 2023 14:17
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
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 13 Mar 2023 03:17
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.
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 13 Mar 2023 03:54
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.
Re: Catalog - add current search as script. How to quicksearch(?) to search in contents
Posted: 13 Mar 2023 04:11
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
