Ways to "shorten down" script?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
burton666
Posts: 49
Joined: 09 Dec 2014, 15:26

Ways to "shorten down" script?

01 Jul 2016, 04:27

I have no problems with this part of my script but it looks pretty ugly and I know alot of you Ahk-wizards only needs a few rows of code where I would have to use like 50 lines.

Can anything be done to shorten down this script?

Code: Select all


^'::
placeholder = % FileTail("c:\test\test.log", 2)
IfInString, placeholder, Inquiry

{
placeholder2 = % FileTail("c:\test\test.log", 14)
NewStr := RegExMatch(placeholder2, "\s*Item\s*:\s*(\d{8})", Artikel)
NewStr := RegExMatch(placeholder2, "\bSub\s*:(\w+)", Sub)
NewStr := RegExMatch(placeholder2, "\bLoc\s*:(.*)", Locator)

Home()
sleep 100
sendinput %Artikel1%{enter}
sendinput %Sub1%{enter}%Locator1%{enter 2}
sleep 100
sendinput {Up}^kBOX{enter}
sleep 3000
placeholder3 = % FileTail("c:\test\test.log", 14)
NewStr := RegExMatch(placeholder3, "\bAvail Qty\s*:(\d+)", Qty)
sleep 100
sendinput %Qty1%{enter}

return
}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, RandomBoy, Rohwedder and 357 guests