How to create an button for a autohotkey script ?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
matu89
Junior Member
Junior Member
Posts: 23
Joined: 2018-02-27, 18:54 UTC

How to create an button for a autohotkey script ?

Post by *matu89 »

hey ,

i wanna create hot key button that run this script :

Code: Select all

ClipboardBak = %ClipboardAll% 
Clipboard = 
PostMessage, 1075, 2018, , , A 
ClipWait 
FileGetTime, TimeStamp, %Clipboard% 
PostMessage, 1075, 907, , , A 
Clipboard = %ClipboardBak% 
FormatTime, TimeStamp, %TimeStamp%, yyyyMMdd 
WinWaitActive, Total Commander ahk_class TCOMBOINPUT 
SendInput, %TimeStamp%
when in create new command name under usercmd.ini it open dialog box with feilds like command , parameters , tooltip etc...

in what feild i need to paste the code ?

thanks .
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to create an button for a autohotkey script ?

Post by *Stefan2 »

matu89 wrote:hey ,

i wanna create hot key button that run this script :

Code: Select all

ClipboardBak = %ClipboardAll% 
Clipboard = 
PostMessage, 1075, 2018, , , A 
ClipWait 
FileGetTime, TimeStamp, %Clipboard% 
PostMessage, 1075, 907, , , A 
Clipboard = %ClipboardBak% 
FormatTime, TimeStamp, %TimeStamp%, yyyyMMdd 
WinWaitActive, Total Commander ahk_class TCOMBOINPUT 
SendInput, %TimeStamp%
when in create new command name under usercmd.ini it open dialog box with feilds like command , parameters , tooltip etc...

in what feild i need to paste the code ?

thanks .

matu89 wrote:in what feild i need to paste the code ?
Nowhere.
Put your code into a text file.




As TC-Button use

Command:"P:\ath\to\AutoHotkey.exe " P:\ath\to\your script file.ahk"
Parameter:
Icon: "P:\ath\to\AutoHotkey.exe"
Tooltip: my nice script to do...





 
matu89
Junior Member
Junior Member
Posts: 23
Joined: 2018-02-27, 18:54 UTC

Post by *matu89 »

hey , thanks for ur reply, im a begginer

i put the code and changed the extention to ahk.

then when making the button in the command feild i put the path of where the code is placed ? ( i put it on the desktop )

i dont know what this path :P:\ath\to\AutoHotkey.exe means .

thank you .
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

1. don't use 'Desktop', use a real folder as like "C:\Temp" or your Total Commander folder.

2. "P:\ath\to\AutoHotkey.exe" means: use YOUR real path where you have the AutoHotkey.exe

You know you need the AutoHotkey.exe to run a AutoHotkey script?



So basically call AutoHotkey.exe and pass your script as parameter.
All in one command line.
Command:"P:\ath\to\AutoHotkey.exe " "P:\ath\to\your script file.ahk"
Parameter:
Icon: "P:\ath\to\AutoHotkey.exe"
Tooltip: my nice script to do...



Or split to
Command:"P:\ath\to\AutoHotkey.exe "
Parameter: "P:\ath\to\your script file.ahk"
Icon: "P:\ath\to\AutoHotkey.exe"
Tooltip: my nice script to do...



Oh!
If you have AutoHotkey INSTALLED (rather then using just the portable zip archive) ,
it may be sufficient to just use the script name in the command box,
as your system then knows itself what to do.
Command: "P:\ath\to\your script file.ahk"
Parameter:
Icon: "P:\ath\to\AutoHotkey.exe"
Tooltip: my nice script to do...





 
matu89
Junior Member
Junior Member
Posts: 23
Joined: 2018-02-27, 18:54 UTC

Post by *matu89 »

Thanks man !
Post Reply