How to use "internal association" for a button command?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

How to use "internal association" for a button command?

Post by *Stefan2 »

Sorry, I searched but found nothing.

I know that internal association is for double click or enter-key use.


But I would like to use a application, once defined in internal association, for use as button command and icon too.


[Associations]
Filter6=*.ahk
Filter6_open=%COMMANDER_PATH%\TOOLs\AHK\AutoHotkey.exe "%1"


Command: <ahk> "%COMMANDER_PATH%\TOOLs\AHK\script.ahk"
Parameter:
Start path:
Icon file: <ahk>
Tooltip: Execute script with application defined in internal association for AHK extension



Note: I think I know other ways, but it have to be a button, since the called script may depend on line position or selection.

Also I already use different ways like
Command: "%COMMANDER_PATH%\AutoHotkey.exe" "%COMMANDER_PATH%\TOOLs\AHK\script.ahk"
or do copy&paste existing buttons, but this is cumbersome to use, and I have to do this for every script again.


If there is no solution yet, I will make a suggestion post.



 
 
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Re: How to use "internal association" for a button command?

Post by *ts4242 »

I don't understand, why you do not create an extended command for the script you want to execute?
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to use "internal association" for a button command?

Post by *Stefan2 »

ts4242 wrote: 2018-09-21, 22:44 UTC I don't understand, why you do not create an extended command for the script you want to execute?
Would be fine too.
How would that work?
[em_A]
cmd=ahk.exe
para=%1

Button
cmd=em_A "D:\rive\path to\script.ext"

:?: Can you help me please?



I want to execute every script with a specific application, without the need to insert the path to that app every single time.
The app I had already specified as internal association and works on double clicking, but I can't use that IA as button command right now.


Spoiler
usercmd.ini
---------------------------
[em_A]
cmd=%Commander_Path%\TOOLs\AHK\AutoHotkey.exe
param=%1
button=%Commander_Path%\TOOLs\AHK\AutoHotkey.exe
---------------------------




X.ahk
---------------------------
msgbox huhu
---------------------------



Button code (load the em command via magnifying glass button!!!)
-------------------------------------------
TOTALCMD#BAR#DATA
em_A c:\temp\X.ahk

%Commander_Path%\TOOLs\AHK\AutoHotkey.exe
Test with em_A and c:\temp\X.ahk


-1
-------------------------------------------



Message
---------------------------
Total Commander
---------------------------
File not found!

em_A c:\temp\X.ahk



"Das System kann die angegebene Datei nicht finden."
---------------------------
OK
---------------------------
 
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Re: How to use "internal association" for a button command?

Post by *ts4242 »

You have to replace %1 with %P%N

Code: Select all

[em_A]
cmd=%Commander_Path%\TOOLs\AHK\AutoHotkey.exe 
param=%P%N
button=%Commander_Path%\TOOLs\AHK\AutoHotkey.exe

More over i think you don't need to create Ex command, e.g.

Code: Select all

TOTALCMD#BAR#DATA
%Commander_Path%\TOOLs\AHK\AutoHotkey.exe
%P%N
%Commander_Path%\TOOLs\AHK\AutoHotkey.exe
AutoHotkey

0
-1
create another button for other programs
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to use "internal association" for a button command?

Post by *Stefan2 »

Thanks for the help ts4242.


As it seams I couldn't explain my issue clear enough to make myself understandable.



 
Post Reply