Using Autohotkey (or other text expanders) on found files

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
dwilbank
Posts: 27
Joined: Sat Jun 28, 2014 2:37 pm

Using Autohotkey (or other text expanders) on found files

Post by dwilbank »

So I search for files, and they're listed in the bottom pane.

Then I try to alter the name of one of them. I hit F2, the name is highlighted, then I go to the end and type a text string which AutoHotKey is supposed to expand into a larger, more complicated string of text.

This never worked. Fine, I thought. Everything is just grabbing whatever 'hooks' AutoHotKey normally listens to. I'll just rename the file manually. For years.

Then one day recently, it actually worked! For about five minutes.

This is just one example. Hit 'b', two spaces, then whatever you type next will be surrounded by square brackets

Code: Select all

:*:b  ::[]{LEFT}
Any insights?

Or anyone use another text expander that works in the file results pane?
Last edited by dwilbank on Thu May 02, 2019 2:33 pm, edited 1 time in total.
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: Using Autohotkey (or other text expanders) on found files

Post by NotNull »

What hotkey are you using in your AHK script? Or are you using hotstrings?

( Maybe just post the script here ..)
dwilbank
Posts: 27
Joined: Sat Jun 28, 2014 2:37 pm

Re: Using Autohotkey (or other text expanders) on found files

Post by dwilbank »

I posted an example hotstring which worked for about five minutes.

(Am going to be away from keyboard most of the day)
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: Using Autohotkey (or other text expanders) on found files

Post by NotNull »

You might be running Everything as administrator.
Windows 10 doesn't allow progams that run under a 'normal account' to talk to to programs run with elevated privileges. (in your case: the AHK code to Everything.

If that is the case, just enable Everything Service and disable Run as administrator. Both can be found under Menu:Tools > Options > General.

There is no reason Everything should block your hotstring.
I tested with this code and it works as intended:

Brackets.ahk

Code: Select all

#NoEnv
#SingleInstance FORCE
#IfWinActive ahk_class EVERYTHING
:*:b  ::[]{LEFT}

vsub
Posts: 432
Joined: Sat Nov 12, 2011 11:51 am

Re: Using Autohotkey (or other text expanders) on found files

Post by vsub »

Can you explain with little more details what exactly you are trying to do...you can tell AHK to rename the selected file

Code: Select all

#IfWinActive,AHK_class EVERYTHING
F2::
KeyWait,F2
StatusBarGetText,File,1,AHK_class EVERYTHING
SplitPath,File,,Dir,Ext,Name
FileMove,% File,% Dir "\[" Name "]." ext 
Return

#If
The code above renames the file from "file name" to "[file name]"
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: Using Autohotkey (or other text expanders) on found files

Post by NotNull »

dwilbank wrote: Thu May 02, 2019 1:44 pm Or anyone use another text expander that works in the file results pane?
Everything has a rather cool multi-file rename utility embedded.
Just select a couple of files (minimum 2) and press F2 (or right-click > Rename or Menu:File > Rename)
Now you can - for example - rename all selected files from
%1.jpg
to
%1 [Holiday Bahamas].jpg
, causing Photo123.jpg and Photo124.jpg to be renamed to "Photo123 [Holiday Bahamas].jpg" resp. "Photo124 [Holiday Bahamas].jpg"


@vsub:: I'm not @dwilbank, but as he/she said "the name is highlighted, then I go to the end and type a text string", I assume he/she wants something different. But I might be wrong.
BTW: Thanks to your script I realized I did not paste the closing #IfWinActive last line, but it turns out the script works regardless. You learn something new every day :)
vsub
Posts: 432
Joined: Sat Nov 12, 2011 11:51 am

Re: Using Autohotkey (or other text expanders) on found files

Post by vsub »

It doesn't have to be #IfWinActive
#If will do the same

And I also learn something new :P
I didn't know Everything have that kind of renaming dialog
dwilbank
Posts: 27
Joined: Sat Jun 28, 2014 2:37 pm

Re: Using Autohotkey (or other text expanders) on found files

Post by dwilbank »

Thanks all,

I disabled 'run as administrator' (had to restart Everything) and my hotkeys worked!

Now I need to see how my life will change now that Everything is running as a service. Not sure everything that implies.

SOLVED
vsub
Posts: 432
Joined: Sat Nov 12, 2011 11:51 am

Re: Using Autohotkey (or other text expanders) on found files

Post by vsub »

Few things will change.
1.Before all programs started from everything were started with admin rights
2.You will be able to use AHK on the everything window and on anything else while the everything window is active
3.You will be able to drop files from\to everything from\to other program(the bad thing is you will not be able to drop files to program that are started with admin rights,that's one annoying windows restriction)
dwilbank
Posts: 27
Joined: Sat Jun 28, 2014 2:37 pm

Re: Using Autohotkey (or other text expanders) on found files

Post by dwilbank »

Thanks mr vsub.
Post Reply