Searching for text inside .ahk files with Everything?

General discussion related to "Everything".
Post Reply
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Searching for text inside .ahk files with Everything?

Post by christophe »

Hi, I need to search inside .ahk files for a text (the text "expanded" for example) inside a folder.
So I have configured .ahk extension as file content:
image.png
image.png (28.3 KiB) Viewed 15974 times
Here is the search in Everything:

Code: Select all

ext:ahk content:expanded
image.png
image.png (23.57 KiB) Viewed 15974 times
but I get absolutely no result, even though I know "expanded" word (same case) in inside my .ahk files!

Why is it not working? (the index has been already build as the Everything config was done months before. Even after forcing rebuild the index it is not working)
Regards
void
Developer
Posts: 19830
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching for text inside .ahk files with Everything?

Post by void »

Remove the spaces from your include only files filter:

*.txt;*.xls;*.xlsx;*.ppt;*.pptx;*.ahk;*.adblock
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Re: Searching for text inside .ahk files with Everything?

Post by christophe »

I have removed the spaces:
image.png
image.png (27.49 KiB) Viewed 15961 times
but the search still provides no result (even after force update of index)
tuska
Posts: 1378
Joined: Thu Jul 13, 2017 9:14 am

Re: Searching for text inside .ahk files with Everything?

Post by tuska »

Hi,

With the file “PreviewConfig.exe”, executed as administrator, you can set that in Everything
- you can search for indexed file contents
- a preview for .AHK files can be displayed

After execution, under Apps > Default Apps > File Type: .ahk ...
the assignment was changed as follows: AutoHotkey Launcher, AutoHotkey Script

The search for file contents or the preview for .ahk files can be performed immediately(!).

Download PreviewHandlerEditor.zip | Preview Handler Association Editor
 
2025-05-16_Preview Handler Association Editor - Extension AHK (AutoHotkey).png
2025-05-16_Preview Handler Association Editor - Extension AHK (AutoHotkey).png (100.99 KiB) Viewed 15940 times
____________________________________________________________
Windows 11 Pro (x64) Version 24H2 (OS build 26100.4061) - 2025-05-13
'Everything' 1.5.0.1391a (x64) - "Portable on system drive C:"
horst.epp
Posts: 1642
Joined: Fri Apr 04, 2014 3:24 pm

Re: Searching for text inside .ahk files with Everything?

Post by horst.epp »

I also have .ahk files content indexed.
Search works perfect.
For preview, I have assigned the Delphi Preview Handler.
It's better than a launcher and makes syntax highlighting.

______________________________________________________
Windows 11 Home Version 24H2 (OS Build 26100.4061)
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Re: Searching for text inside .ahk files with Everything?

Post by christophe »

If I am correct, PreviewConfig.exe is to register file types for the Preview Pane in Windows Explorer, that Windows not natively support.

How can this solve the problem of Everything search not able to find the word "expander" inside .ahk files?
My problem is that Everything Search is not even providing the .ahk files containing the word "expander". Having a preview of them would be nice as well, but I first need to have Everything Search find those proper .ahk files with this content.
Last edited by christophe on Fri May 16, 2025 8:58 pm, edited 1 time in total.
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Re: Searching for text inside .ahk files with Everything?

Post by christophe »

@horst.epp
horst.epp wrote: Fri May 16, 2025 2:59 pm I also have .ahk files content indexed.
Search works perfect.
How have you managed to configure Everything Search to search inside .ahk files?
When I type:

Code: Select all

ext:ahk content:expanded
, I get no results at all even though my .ahk files contain this word
tuska
Posts: 1378
Joined: Thu Jul 13, 2017 9:14 am

Re: Searching for text inside .ahk files with Everything?

Post by tuska »

christophe wrote: Fri May 16, 2025 8:49 pm ... I first need to have Everything Search find those proper .ahk files with this content.
Everything 1.5.0.1391a (x64) finds the file content “expander” on my computer.
Please see also my picture above.

... "word "expander" inside .ahk files" <=> "expanded" :?:
 
2025-05-17_content_expander.png
2025-05-17_content_expander.png (83.63 KiB) Viewed 15877 times
 
Please take a look at this post.
void
Developer
Posts: 19830
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching for text inside .ahk files with Everything?

Post by void »

Everything uses the system iFilter to search content.
Everything will fallback to text/plain if there's no AHK iFilter.

There might be something up with your AHK iFilter?

Please try adding AHK to your Everything text/plain extensions:
  • In Everything 1.5, from the Tools menu, under the Debug submenu, click Config.
    ---this will open your %APPDATA%\Everything\Everything.ini in Notepad.
  • Change the following line:

    Code: Select all

    text_plain_extensions=a;ans;asc;ascx;asm;asp;aspx;asx;bas;bat;bcp;btm;c;cc;cls;cmd;contact;cpp;cs;csa;csproj;css;csv;cxx;dbs;def;dic;dos;dsp;dsw;efu;ext;faq;fky;h;hhc;hpp;hta;htm;html;htt;htw;htx;hxx;i;ibq;ics;idl;idq;inc;inf;ini;inl;inx;jav;java;js;json;kci;lgn;lst;lua;m3u;mak;mk;odc;odh;odl;php;pl;prc;ps1xml;py;rc;rc2;rct;reg;rgs;rul;s;scc;shtm;shtml;sol;sql;srf;stm;tab;tdl;tlh;tli;trg;txt;udf;udt;user;usr;vbproj;vbs;vcproj;viw;vspscc;vsscc;vssscc;wri;wtx;xml;xsd;xsl;xslt
    to:

    Code: Select all

    text_plain_extensions=a;ans;asc;ascx;asm;asp;aspx;asx;bas;bat;bcp;btm;c;cc;cls;cmd;contact;cpp;cs;csa;csproj;css;csv;cxx;dbs;def;dic;dos;dsp;dsw;efu;ext;faq;fky;h;hhc;hpp;hta;htm;html;htt;htw;htx;hxx;i;ibq;ics;idl;idq;inc;inf;ini;inl;inx;jav;java;js;json;kci;lgn;lst;lua;m3u;mak;mk;odc;odh;odl;php;pl;prc;ps1xml;py;rc;rc2;rct;reg;rgs;rul;s;scc;shtm;shtml;sol;sql;srf;stm;tab;tdl;tlh;tli;trg;txt;udf;udt;user;usr;vbproj;vbs;vcproj;viw;vspscc;vsscc;vssscc;wri;wtx;xml;xsd;xsl;xslt;ahk
    (add
    ;ahk
    to the end)
  • Save changes and exit Notepad.
  • Accept the prompt in Everything to reload your config.
Everything will always treat these files as text/plain, avoiding any iFilters.

I will add ahk to the default text/plain extension list.



Please make sure no search options are checked under the Search menu (eg: uncheck match case, uncheck match whole words, uncheck regex)

Please make sure the Everything filter is active under the Search menu.



Please try a search without content:
-does Everything find your AHK files?



Please try the following search to check what content Everything has indexed:
*.ahk add-column:a a:=$content:

Content is shown in the temporary A column.
horst.epp
Posts: 1642
Joined: Fri Apr 04, 2014 3:24 pm

Re: Searching for text inside .ahk files with Everything?

Post by horst.epp »

My AHK IFilter search options are set to use the Microsoft Plain Text Filter.
No other Everything Options are needed in this case.
Screenshot - 17.05.2025 , 13_14_34.png
Screenshot - 17.05.2025 , 13_14_34.png (34.18 KiB) Viewed 15809 times
You can set extensions to iFilters with NirSofts
https://www.nirsoft.net/utils/search_filter_view.html
______________________________________________________
Windows 11 Home Version 24H2 (OS Build 26100.4061)
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Re: Searching for text inside .ahk files with Everything?

Post by christophe »

void wrote: Fri May 16, 2025 11:19 pm Everything uses the system iFilter to search content.
Everything will fallback to text/plain if there's no AHK iFilter.

There might be something up with your AHK iFilter?

Please try adding AHK to your Everything text/plain extensions:
  • In Everything 1.5, from the Tools menu, under the Debug submenu, click Config.
    ---this will open your %APPDATA%\Everything\Everything.ini in Notepad.
  • Change the following line:

    Code: Select all

    text_plain_extensions=a;ans;asc;ascx;asm;asp;aspx;asx;bas;bat;bcp;btm;c;cc;cls;cmd;contact;cpp;cs;csa;csproj;css;csv;cxx;dbs;def;dic;dos;dsp;dsw;efu;ext;faq;fky;h;hhc;hpp;hta;htm;html;htt;htw;htx;hxx;i;ibq;ics;idl;idq;inc;inf;ini;inl;inx;jav;java;js;json;kci;lgn;lst;lua;m3u;mak;mk;odc;odh;odl;php;pl;prc;ps1xml;py;rc;rc2;rct;reg;rgs;rul;s;scc;shtm;shtml;sol;sql;srf;stm;tab;tdl;tlh;tli;trg;txt;udf;udt;user;usr;vbproj;vbs;vcproj;viw;vspscc;vsscc;vssscc;wri;wtx;xml;xsd;xsl;xslt
    to:

    Code: Select all

    text_plain_extensions=a;ans;asc;ascx;asm;asp;aspx;asx;bas;bat;bcp;btm;c;cc;cls;cmd;contact;cpp;cs;csa;csproj;css;csv;cxx;dbs;def;dic;dos;dsp;dsw;efu;ext;faq;fky;h;hhc;hpp;hta;htm;html;htt;htw;htx;hxx;i;ibq;ics;idl;idq;inc;inf;ini;inl;inx;jav;java;js;json;kci;lgn;lst;lua;m3u;mak;mk;odc;odh;odl;php;pl;prc;ps1xml;py;rc;rc2;rct;reg;rgs;rul;s;scc;shtm;shtml;sol;sql;srf;stm;tab;tdl;tlh;tli;trg;txt;udf;udt;user;usr;vbproj;vbs;vcproj;viw;vspscc;vsscc;vssscc;wri;wtx;xml;xsd;xsl;xslt;ahk
    (add
    ;ahk
    to the end)
  • Save changes and exit Notepad.
  • Accept the prompt in Everything to reload your config.
Everything will always treat these files as text/plain, avoiding any iFilters.

I will add ahk to the default text/plain extension list.



Please make sure no search options are checked under the Search menu (eg: uncheck match case, uncheck match whole words, uncheck regex)

Please make sure the Everything filter is active under the Search menu.



Please try a search without content:
-does Everything find your AHK files?
I have added ahk to text_plain_extensions in the .ini and after this searching inside .ahk files works :) thank you
void wrote: Fri May 16, 2025 11:19 pm Please try the following search to check what content Everything has indexed:
*.ahk add-column:a a:=$content:

Content is shown in the temporary A column.
Here is what I have as a result (I even had this result before doing the .ini modification, I don't know if this means something)
image.png
image.png (66.84 KiB) Viewed 15751 times
Should I better fix something with the iFilter ? or leave the ahk entry in text_plain_extension ?
horst.epp
Posts: 1642
Joined: Fri Apr 04, 2014 3:24 pm

Re: Searching for text inside .ahk files with Everything?

Post by horst.epp »

christophe wrote: Sat May 17, 2025 5:21 pm ...
Should I better fix something with the iFilter ? or leave the ahk entry in text_plain_extension ?
I always prefer system-wide solutions
as I use several file managers and Windows Explorer in addition to Everything.
So the iFilter setting makes searching work in any context.
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Re: Searching for text inside .ahk files with Everything?

Post by christophe »

I agree, a system-wide solution is better. How could I then fix the current problematic AHK filter?
If I understand correctly, the iFilter for AHK files is not functional on my Windows. As a consequence, Everything does not search inside .ahk files. The workaround was to configure Everything so that .ahk files are considered as plain text files to bypass the AHK file filter, but this is limited to Everything.
horst.epp
Posts: 1642
Joined: Fri Apr 04, 2014 3:24 pm

Re: Searching for text inside .ahk files with Everything?

Post by horst.epp »

christophe wrote: Sun May 18, 2025 7:43 am I agree, a system-wide solution is better. How could I then fix the current problematic AHK filter?
If I understand correctly, the iFilter for AHK files is not functional on my Windows. As a consequence, Everything does not search inside .ahk files. The workaround was to configure Everything so that .ahk files are considered as plain text files to bypass the AHK file filter, but this is limited to Everything.
It's not an iFilter for AHK,
it's the Windows Plain Text filter which should work in your Windows 7.

My Windows 11 is an upgrade over all version from 7 to 11
and the Standard iFilters are still the same.

Use the Nirsoft Tool "SearchFilterView"
and add the .ahk extension to the Windows Plain Text filter
as shown in my screenshot from above.
https://www.nirsoft.net/utils/search_filter_view.html
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Re: Searching for text inside .ahk files with Everything?

Post by christophe »

Thank you, the search inside .ahk files is now working.

How do you get a search with a preview of the search word position inside the file in the Everything Preview?
image.png
image.png (124.62 KiB) Viewed 15134 times
I have the preview of the .ahk file, but I don't have the word position inside the preview.
When I search for a word inside a .txt file, it is the same: I can see the .txt in the preview, but I do not get the exact position of the word inside the .txt file.
horst.epp
Posts: 1642
Joined: Fri Apr 04, 2014 3:24 pm

Re: Searching for text inside .ahk files with Everything?

Post by horst.epp »

christophe wrote: Tue May 20, 2025 12:32 pm ...
How do you get a search with a preview of the search word position inside the file in the Everything Preview?
I don't know any previewer which does this.
I guess the best you may get in the future is,
that David enhances content search results with such informations.
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Re: Searching for text inside .ahk files with Everything?

Post by christophe »

So the blue highlighting in this screenshot is a post-production element? It looks like a feature integrated into the Everything search.
That would have been a useful additional feature.
tuska
Posts: 1378
Joined: Thu Jul 13, 2017 9:14 am

Re: Searching for text inside .ahk files with Everything?

Post by tuska »

christophe wrote: Tue May 20, 2025 2:02 pm So the blue highlighting in this screenshot is a post-production element?
Yes, I colored this section to make it stand out visually.
christophe
Posts: 51
Joined: Wed Mar 22, 2023 12:05 pm

Re: Searching for text inside .ahk files with Everything?

Post by christophe »

That was so well done, I thought it was Everything 😀
Post Reply