script to execute specific search

Discuss and share scripts and script files...
admin
Site Admin
Posts: 64882
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re:

Post by admin »

Just adding the new LoadSearch command to scripting!

Question: Never using Search Templates myself I wondered whether "SelectedLocations" and "AutoSync" really should be stored with the search template??? I'd think NOT! What do you think?

Apart from that: very cool command! You now can e.g. list any 2 directories in one list on a single click by loadsearching a template with 2 search locations. And much more...

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Re:

Post by j_c_hallgren »

admin wrote:Question: Never using Search Templates myself I wondered whether "SelectedLocations" and "AutoSync" really should be stored with the search template??? I'd think NOT! What do you think?
What is your reasoning for this? Before I answer the question, I'd like to know as I thought the concept of having a template was to be able to repeat a search as it was configured before.

Now admittedly, I use templates only rarely so I may not be a good sample for this 'survey', but wanted to try anyway.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

admin
Site Admin
Posts: 64882
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Re:

Post by admin »

j_c_hallgren wrote:
admin wrote:Question: Never using Search Templates myself I wondered whether "SelectedLocations" and "AutoSync" really should be stored with the search template??? I'd think NOT! What do you think?
What is your reasoning for this? Before I answer the question, I'd like to know as I thought the concept of having a template was to be able to repeat a search as it was configured before.
reasoning: both are not properties of a search but settings that control how/if the location field is automatically filled. In a stored search this makes no sense since the location is stored with the search.
SelectedLocations might be okay if you load a template without loading the stored location. But AutoSync is useless because it only makes sense in relation to browsing to new locations.
But somebody should reply who actually uses templates... :)

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Re:

Post by j_c_hallgren »

admin wrote:SelectedLocations might be okay if you load a template without loading the stored location. But AutoSync is useless because it only makes sense in relation to browsing to new locations.
But somebody should reply who actually uses templates... :)
I said I use them, just not that often! :wink:

Anyway, that's what I was thinking also...I agree that AutoSync makes no sense, ,but that Selected Locations could affect results if one thought it was being saved as part of Template and it wasn't.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Re:

Post by jacky »

admin wrote:Question: Never using Search Templates myself I wondered whether "SelectedLocations" and "AutoSync" really should be stored with the search template??? I'd think NOT! What do you think?
hmm.. I do use them, though not daily, and I could see where the question comes from, though I would say that it could be odd that only those two options are excluded from ST, some people could actually have a ST that enabled "Selected locations" because one always selects a bunch of folders/drives and loads the ST to search them. I know I don't, but it could be done.

For "Auto sync" it could seems totally useless, but consider this case: you load a search template with auto sync ON, while it currently if OFF, then it you don't load the search location (one of the option available on loading) the search location is set to the current one.
So, for someone who doesn't load the search location and doesn't usually uses auto-sync, it could have a point.

And since there's no way to start a search by fully defining the criteria from a script command, might be good to let ST access all the available options, no?


PS: Okay, so ::loadsearch doesn't work (yeah I tried ;)) but gave the same error as ::info or any not existing command -- isn't that one (info) a real command, giving version number, loaded INI, command line, <xypath>, <xydata>, etc ?? :?
Proud XYplorer Fanatic

admin
Site Admin
Posts: 64882
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Re:

Post by admin »

jacky wrote:PS: Okay, so ::loadsearch doesn't work (yeah I tried ;)) but gave the same error as ::info or any not existing command -- isn't that one (info) a real command, giving version number, loaded INI, command line, <xypath>, <xydata>, etc ?? :?
Yes, it was a little glitchy today. Try again in next upload.

Hint: :wink:

Code: Select all

      ' syntax: loadsearch template, [options=rl]
      '   template: search template name
      '             as displayed in the search template dialog
      '   options:  r = run search
      '             l = load search location
      '             e = load excluded folders
      ' ::loadsearch "Created or Modified This Hour", r
You see, I took your syntax suggestion 100%. :)

Post Reply