load search template and open search box directly

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

load search template and open search box directly

Post by yusef88 »

can i load search template and open search box directly instead press ctrl+f then load template
Attachments
2014-06-18_215451.png
2014-06-18_215451.png (13.49 KiB) Viewed 4483 times

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

Re: load search template and open search box directly

Post by highend »

Scripting would help...

Code: Select all

    $template = popupmenu(replace(listfolder("<xydata>\FindTemplates", "*.ini", 4), ".ini"));
    loadsearch $template, "x";
    #260;
Depending on what you need, you eventually have to edit the "x" (see help file for loadsearch()).
One of my scripts helped you out? Please donate via Paypal

yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: load search template and open search box directly

Post by yusef88 »

excellent :appl: your script leads me to read in help file, to load certian template i use this
loadsearch "1", l ;#260;

yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: load search template and open search box directly

Post by yusef88 »

why variables like "%computer%" "%programfiles%" don't work in find files
Attachments
2014-06-19_005414.png
2014-06-19_005414.png (25.81 KiB) Viewed 4463 times
Last edited by yusef88 on 18 Jun 2014 23:56, edited 1 time in total.

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

Re: load search template and open search box directly

Post by highend »

For the location field?
%programfiles% works fine for me...
One of my scripts helped you out? Please donate via Paypal

yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: load search template and open search box directly

Post by yusef88 »

try it in excluded folders it won't work

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

Re: load search template and open search box directly

Post by highend »

try it in excluded folders it won't work
You should be able to exclude it when you store it with the template and use the "e" option for loadsearch()
One of my scripts helped you out? Please donate via Paypal

yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: load search template and open search box directly

Post by yusef88 »

Code: Select all

::loadsearch "pc", l;#260;"
when using above command can fill search box by words exist in "<clipboard>" or in general start a search with clipboard ?

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

Re: load search template and open search box directly

Post by highend »

Extend the script by making a temp version of the template and insert what's currently in the clipboard into it and load that one instead.
One of my scripts helped you out? Please donate via Paypal

yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: load search template and open search box directly

Post by yusef88 »

mean like this?

Code: Select all

[Named]
Named="Test"
but what is the clipboard is variable and change every time i need something similar to that

Code: Select all

tab("new", "<clipboard>");

Code: Select all

?"<clipboard>"

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

Re: load search template and open search box directly

Post by highend »

No... Templates don't support variables that you can only get by scripting.

Code: Select all

    $template = "<xydata>\FindTemplates\pc.ini";
    $content = regexreplace(readfile($template), "^(Named="")([^""]+)", "$1<clipboard>");
    writefile($template, $content);
    loadsearch getpathcomponent($template, "base"), "l";
One of my scripts helped you out? Please donate via Paypal

yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: load search template and open search box directly

Post by yusef88 »

it works perfectly,thanks :D

Post Reply