Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Drummerforlife

help needed for autohotkey for workflow

This should work for that:

 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


;Lines that start with a semicolon (;) are comments and only there to clarify statements.
;^ means Ctrl and I think Numpad1 and all other keycodes are pretty obvious. 
;You might need to adjust the sleep according to your use/program/PC
^Numpad1::
	SendInput, {Backspace}
	Sleep, 50
	SendInput, {Up}
	Sleep, 50
	SendInput, {Enter}
	Sleep, 50
	SendInput, {F8}
Return

I have generally found sleep for 50 to be quite good, but you might need to adjust that after testing.

 

 

(Also, this code is assuming you want to press one key after another, not have the program press them all at once)

Recommended Posts

Posted · Original PosterOP

Morning guys, 

I've been meaning to try and implement hotkeys for my work. I'm working in warehouse inventory and I'm looking at options to reduce the amount of movements needed to do task while logging in the work. What I have in my mind is the following.

 

hotkey ctrl + Numpad 1 = (key press backspace, arrow key up, enter, F8)

 

 

Due to lack of time I cant sit down to give it a try on my own and which is why I'm asking for help here. thanks for those willing to give this a go.

if I'm missing any info needed let me know I'll try my best to reply on a short notice

 

 

Link to post
Share on other sites
Posted · Best Answer

This should work for that:

 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


;Lines that start with a semicolon (;) are comments and only there to clarify statements.
;^ means Ctrl and I think Numpad1 and all other keycodes are pretty obvious. 
;You might need to adjust the sleep according to your use/program/PC
^Numpad1::
	SendInput, {Backspace}
	Sleep, 50
	SendInput, {Up}
	Sleep, 50
	SendInput, {Enter}
	Sleep, 50
	SendInput, {F8}
Return

I have generally found sleep for 50 to be quite good, but you might need to adjust that after testing.

 

 

(Also, this code is assuming you want to press one key after another, not have the program press them all at once)


"There's no such thing as perfect. You're beautiful as you are Courage. With all your imperfections you can do anything." - Bathtub Barracuda

"How can someone win if winning means that someone loses" - Scatman John

"We’re here to make you think about death and get sad and stuff.” - Scott Pilgrim

Gear:                           .                                                                                                                         .

Spoiler

PC:

CPU: AMD Ryzen 7 1700 || Motherboard: MSI X370 Gaming Pro Carbon || RAM: 2x8GB G.Skill TridentZ RGB 3200Mhz (running at 2933Mhz) || GPU: Gigabyte Auros RX 580 4GB || Storage: Samsung 960 EVO 250GB + Seagate Barracuda 2TB || Cooling: Be Quiet! Dark Rock 3 || Case: Thermaltake Core G21 TG || PSU: Corsair RMx 750W

Peripherals:

Headphones: Beyerdynamic DT-990 250 Ohm || Mouse: Roccat Kiro || Keyboard: Coolermaster Masterkeys Pro S RGB || Mousepad: CM Storm Swift-RX XXL || Graphics tablet: Wacom Intuos Pen Small

Old PC:

CPU: AMD Athlon X2 255 || Motherboard: ASUS M4A89GTD PRO || RAM: 4x2GB DDR3 || GPU: Nvidia Quadro 512MB || Case: Antec Sonata III || PSU: Antec Earthwatts 500W Bronze

Minibois' Digital Art Thread

Reviews: Coolermaster Masterkeys Pro S RGB || Wacom Intuos Pen Small || Roccat Kiro

Threads: Pokémon Thread || Dutch Talk || Super Smash Bros. Melee Thread

Setup: Current setup

Link to post
Share on other sites
Posted · Original PosterOP
On ‎3‎/‎11‎/‎2019 at 12:30 PM, Minibois said:

This should work for that:

 


#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


;Lines that start with a semicolon (;) are comments and only there to clarify statements.
;^ means Ctrl and I think Numpad1 and all other keycodes are pretty obvious. 
;You might need to adjust the sleep according to your use/program/PC
^Numpad1::
	SendInput, {Backspace}
	Sleep, 50
	SendInput, {Up}
	Sleep, 50
	SendInput, {Enter}
	Sleep, 50
	SendInput, {F8}
Return

I have generally found sleep for 50 to be quite good, but you might need to adjust that after testing.

 

 

(Also, this code is assuming you want to press one key after another, not have the program press them all at once)

This worked amazingly well, thank you, Tho would it be possible to add one extra step at the end for another input, a combined press of Ctrl Shift and F8 (Ctrl+Shift+F8) or would AHK not be able to do it?

Link to post
Share on other sites
42 minutes ago, Drummerforlife said:

This worked amazingly well, thank you, Tho would it be possible to add one extra step at the end for another input, a combined press of Ctrl Shift and F8 (Ctrl+Shift+F8) or would AHK not be able to do it?

AHK is certainly able to do that :) 

Just add this where you need it:

; This command first pressed Ctrl down, then Shift down and only then presses F8 to ensure F8 is pressed while the others are down.
SendInput, {Ctrl down}{Shift down}{F8}{Ctrl up}{Shift up}

 


"There's no such thing as perfect. You're beautiful as you are Courage. With all your imperfections you can do anything." - Bathtub Barracuda

"How can someone win if winning means that someone loses" - Scatman John

"We’re here to make you think about death and get sad and stuff.” - Scott Pilgrim

Gear:                           .                                                                                                                         .

Spoiler

PC:

CPU: AMD Ryzen 7 1700 || Motherboard: MSI X370 Gaming Pro Carbon || RAM: 2x8GB G.Skill TridentZ RGB 3200Mhz (running at 2933Mhz) || GPU: Gigabyte Auros RX 580 4GB || Storage: Samsung 960 EVO 250GB + Seagate Barracuda 2TB || Cooling: Be Quiet! Dark Rock 3 || Case: Thermaltake Core G21 TG || PSU: Corsair RMx 750W

Peripherals:

Headphones: Beyerdynamic DT-990 250 Ohm || Mouse: Roccat Kiro || Keyboard: Coolermaster Masterkeys Pro S RGB || Mousepad: CM Storm Swift-RX XXL || Graphics tablet: Wacom Intuos Pen Small

Old PC:

CPU: AMD Athlon X2 255 || Motherboard: ASUS M4A89GTD PRO || RAM: 4x2GB DDR3 || GPU: Nvidia Quadro 512MB || Case: Antec Sonata III || PSU: Antec Earthwatts 500W Bronze

Minibois' Digital Art Thread

Reviews: Coolermaster Masterkeys Pro S RGB || Wacom Intuos Pen Small || Roccat Kiro

Threads: Pokémon Thread || Dutch Talk || Super Smash Bros. Melee Thread

Setup: Current setup

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×