Running commands through aliases in input box

130 views
Skip to first unread message

androidof...@gmail.com

unread,
Oct 29, 2015, 3:33:11 AM10/29/15
to hoekey
Discovering new things in this proggy everyday

I am not able to run alias commands through inputbox. For eg., I've described a new alias as
*np=Run|notepad.exe
^R=Input|Enter alias to run:|||%u=RunAlias|%u

nothing happens. Where did I go wrong. The same alias when run directly through hotkey executes properly.

Also is there a variable to get the full path of the foreground window?


androidof...@gmail.com

unread,
Oct 29, 2015, 1:19:14 PM10/29/15
to hoekey
BTW, is it possible to use aliases as a variable to be used elsewhere. For eg.,  can I define
*sdir=E:/system
and use it elsewhere as,
~N=Run|%sdir%/hoekey/hoekey.exe
???
Is there any possibility to define user defined variables?
Thanks.

Timothy Rice

unread,
Nov 2, 2015, 1:17:16 PM11/2/15
to hoekey
The documentation was missing newlines, the command you're really after was:
I fixed the docs:

But I really don't think aliases were ever all that useful.  So I've changed them over to something more like you were thinking, but like so:
*TimTest=Some dir:%c
~Y=MsgBox|Aliased: %{timtest}

And removed RunAlias altogether.  I haven't updated the documentation for this yet, but it's in the changelog on main page.

androidof...@gmail.com

unread,
Nov 2, 2015, 9:58:22 PM11/2/15
to hoekey

But I really don't think aliases were ever all that useful.  So I've changed them over to something more like you were thinking, but like so:
*TimTest=Some dir:%c
~Y=MsgBox|Aliased: %{timtest}

And removed RunAlias altogether.  I haven't updated the documentation for this yet, but it's in the changelog on main page.
 
uh..oh... that's not my intention. I really loved the option of running aliases through input box. I have literally hundreds of programs in my PC, many of them I don't use that often. Using hotkeys for them is not much useful, as I wouldn't remember those rarely used hotkeys, but I can easily remember the aliases. I now use a program called slickrun to do that. I would really love to move all my aliases to hoekey.

I'm extremely grateful for the new user defined variable. It would tremendously increase the versatility of the program.

I've tried to use your latest modification to try to run programs through input box. The tried the following
*ep="%C\..\...\epcheck\epcheck.exe"
~Y=Input|Enter alias to run:|||%u
    =Run|%{%u}
but it does not work. Why? Is it still possible to run aliases (or user defined variable as it is now) from the input box?. If not, is it possible to bring back the runalias command without disrupting the new modification? Sorry for being such a pain.

Timothy Rice

unread,
Nov 4, 2015, 7:45:36 PM11/4/15
to hoekey
Hah - this was certainly the original reason for this feature, and the example in the docs.  I've added RunAlias back and now also show them in the config dialog box.

String-replace aliases are now referred to as "defines".

androidof...@gmail.com

unread,
Nov 5, 2015, 12:03:01 AM11/5/15
to hoekey

I've added RunAlias back and now also show them in the config dialog box.

so, I get to have the cake ...

String-replace aliases are now referred to as "defines".

...and eat it too!!!

Thanks for the changes. BTW, a small query regarding the use of quotes for "defines"

I wanted to define a base folder for all my software and use it later
%basedir="G:\Software\"
*npp="%{basedir}\notepad++\notepad++.exe"  <=== does not work
*npp=%{basedir}"\notepad++\notepad++.exe"  <=== does not work
*npp=%{basedir}\notepad++\notepad++.exe  <=== does not work

%basedir=G:\Software\
*npp=%{basedir}\notepad++\notepad++.exe  <=== Only this combination works (quotes nowhere)

It seems I can't use quotes anywhere either in the variable definition or in the alias definiton. The variable seems to bring the quotes along with it. Is it intended? or am I doing something idiotic (most probably)?

Also, I want to open the foreground window directory in multicommander in a new tab with the command
%{basedir}\multicommander\multicommander.exe /OPEN %c
but it always opens with the C folder rather than the active window folder. Is my usage of the arguments correct? Anyway you can help? Thanks.

Timothy Rice

unread,
Nov 9, 2015, 12:15:34 PM11/9/15
to hoekey
There was a bug where it was dropping the first char from the define.  With 1.22, you should quote only the full path, like this:
%basedir=G:\Software\

*npp="%{basedir}\notepad++\notepad++.exe"

Re:

Also, I want to open the foreground window directory in multicommander in a new tab with the command
%{basedir}\multicommander\multicommander.exe /OPEN %c
but it always opens with the C folder rather than the active window folder. Is my usage of the arguments correct? Anyway you can help? Thanks.

There's a couple reasons this may not work:
- Foreground app doesn't change it's internal current directory, so you'll always see it's starting directory or something else.
- Display of the current directory cannot be read as it can from Windows Explorer.
- Foreground app is 64 bit.  HoeKey cannot currently read a 64-bit app's internal current directory.

If this is Multicommander that you are trying to open another Multicommander window from, I do see that it uses custom draw controls and doesn't set their window text, so hoekey can't treat it like explorer. I did add "%z" to get just the directory from the current selection, maybe that can help?

androidof...@gmail.com

unread,
Nov 12, 2015, 8:25:01 AM11/12/15
to hoekey
There was a bug where it was dropping the first char from the define.  With 1.22, you should quote only the full path, like this:
%basedir=G:\Software\
*npp="%{basedir}\notepad++\notepad++.exe"

Thanks for the new version. Will play some more with it.

 
If this is Multicommander that you are trying to open another Multicommander window from, I do see that it uses custom draw controls and doesn't set their window text, so hoekey can't treat it like explorer. I did add "%z" to get just the directory from the current selection, maybe that can help?

No, I'm not trying to open only the multicommander dir, but other programs too. Anyway will try your new version and get back.
 
Reply all
Reply to author
Forward
0 new messages