 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Do you use dynamic commands? |
| Yes |
|
75% |
[ 9 ] |
| No |
|
25% |
[ 3 ] |
|
| Total Votes : 12 |
|
| Author |
Message |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
Posted: Sat Feb 07, 2009 8:44 pm Post subject: OneLineCommands (Execute AHK code dynamically!) |
|
|
I wanted to bring back this topic to live: Execute AHK code dynamically!
My function does quite the same but in a little different way and it offers additionally a small debug feature as well as one line if statements, such as IfEqual, IfGreater, IfExist, IfWinActive...:
| Code: | | #("IfWinActive", "ahk_class ExploreWClass","","","","MsgBox", WinExist()) |
If var ">|<|=|is|is not" is also used that way:
| Code: | | #("If", "var", "is", "digit","MsgBox") |
As far as I understand, using this function performance is not affected at all, at least using new AutoHotkey.exe beta.
All commands excluding loop commands and Return are supported. Instead of Return use Exit
| Code: | #("Command", "parameter1","parameter2",...)
;Each command has an abbreviation:
; Sleep= S, Send = SN, IfWinActive = IWA, IfExist = IE,IfEqual = IEQ, ControlGet = CG,...
|
Using this function you can execute many commands in one line.
| Code: | ;Instead of:
Loop, C:\*.txt,0,1
{
command
command
command
}
;you can do
Loop, C:\*.txt,0,1
#("command") #("command") #("command")
|
Instead of If expression you can use ? : (Ternary operator [v1.0.46+])
For example:
| Code: | debug := WinExist("ahk_class ExploreWClass") ? #("WinActivate","ahk_class ExploreWClass") : #("Run","explorer /e")
MsgBox % debug |
Small debuging feature:
| Code: | Such commands, that change the variable ErrorLevel, use this SubCommand to return a value for debuging:
Return:
Return A_Tab . "ErrorLevel: " . Errorlevel . "`t" . p1 . "," . p2 . "," . p3 . "," . p4 . "," . p5 . "," . p6 . "," . p7 . "," . p8 . "," . p9 . "," . p10 . "," . p11 . "," . p12 . "," . p13 . "," . p14 . "," . p15 . "," . p16 . "," . p17 . "," . p18 . "," . p19 . "," . p20 "`n"
;Change this line to your needs, include parameters as well as AutoHotKey variables like ErrorLevel, A_Index, A_LoopField,... |
You can also add your custom functions as if they were commands (look at PixelWaitColor command in the code)
If you find any errors or you have a suggestion, please post
Function and Example:
| Code: | #Persistent
#("Gui","font", "s16") #("Gui","Add","Button","w200 h70 gDemo1","Demo1`n3 lines only") #("Gui","Add","Button","x+20 w200 h70 gDemo2","Demo2`n1 line + subs") #("Gui","Add","text", "xs","Press Win+z for one line Menu") #("Gui","Add","text", "xs", "Press Win+t for one line multi-command hotkey") #("Gui", "font", "10") #("Gui","Show","w500 h180","Demo OneLineCommands")
Return
#a::#("IWA","ahk_class ExploreWClass","","","","MsgBox","Active")
#b::#("If",1,"=",1,"MsgBox")
;##############################################################################################
;Hotkey Example
#t::#("FSF","file","","","Hello`, Select file") #("FGS","size",file,"KB") #("MB","File: " file "`nSizeKB: " size)
#z::#("Menu", "MyMenu", "Add", "Item1", "MenuHandler") #("Menu", "MyMenu", "Add", "Item2", "MenuHandler") #("Menu", "MyMenu", "Add") #("Menu", "Submenu1", "Add", "Item1", "MenuHandler") #("Menu", "Submenu1", "Add", "Item2", "MenuHandler") #("Menu", "MyMenu", "Add", "My Submenu", ":Submenu1") #("Menu", "MyMenu", "Add") #("Menu", "MyMenu", "Add", "Item3", "MenuHandler") #("Menu", "MyMenu", "Show") #("Menu","MyMenu","DeleteAll")
Return
MenuHandler:
MsgBox You selected %A_ThisMenuItem% from the menu %A_ThisMenu%.
return
;##############################################################################################
Demo1:
Loop 26
debug .= "Index: " . A_Index . " Checking: " . Chr(A_Index+96) ":\" . "`n" . #("DG","serial","Serial",Chr(A_Index+96) ":\")
. #("DG","filesys","FS",Chr(A_Index+96) ":\") . #("DG","label","Label",Chr(A_Index+96) ":\")
. #("DG","type","type",Chr(A_Index+96) ":\") . #("DG","stat","Status",Chr(A_Index+96) ":\")
. #("DG","statcd","StatusCD",Chr(A_Index+96) ":\") . #("DG","hdsize","Cap",Chr(A_Index+96) ":\")
. #("AWG") ;this command does not exist see debug output
. #("DG","wrong") ;wrong syntax see debug output
. (out .= !serial ? "" : ("Drive: " Chr(A_Index+96) ":\" . "`nLabel: " . label . "`nStat: " . stat
. "`nStatCD: " . statCD . "`nFS: " . filesys . "`nType: " . type . "`nSerial:" . serial . "`nSize: " hdsize . " MB`n`n"))
#("G","2:+AlwaysOnTop"),#("G","2:Add","Text","","Output")
,#("G","2:Add","Edit"," xs w600 h300",out),#("G","2:Add","Text","xs","Debuger")
,#("G","2:Add","Edit","xs w600 h300",Debug),#("G","2:Show","","OneLineCommands - Get Drives List")
Return
2GuiClose:
Gui, 2:Destroy
Return
GuiClose:
ExitApp
;##############################################################################################
Demo2:
#("Gui","3:+Resize") #("Gui","3:Default") #("Gui", "3:Add", "Button", "Default gButtonLoadFolder", "Load a folder") #("Gui", "3:Add", "Button", "x+20 gButtonClear", "Clear List") #("Gui", "3:Add", "Button", "x+20 gButtonSwitchView", "Switch View") #("Gui", "3:Add", "ListView", "xm r20 w700 vMyListView gMyListView", "Name|In Folder|Size (KB)|Type") LV_ModifyCol(3, "Integer") (ImageListID1 := IL_Create(10)) (ImageListID2 := IL_Create(10, 10, true)) LV_SetImageList(ImageListID1) LV_SetImageList(ImageListID2) #("Menu", "MyContextMenu", "Add", "Open", "ContextOpenFile") #("Menu", "MyContextMenu", "Add", "Properties", "ContextProperties") #("Menu", "MyContextMenu", "Add", "Clear from ListView", "ContextClearRows") #("Menu", "MyContextMenu", "Default", "Open") #("Gui", "3:Show","","OneLineCommands - List Files")
return
ButtonLoadFolder:
#("Gui", "3:+OwnDialogs"),#("Gui", "3:Default"),#("FileSelectFolder", "Folder","", "3", "Select a folder to read:")
if not Folder ; The user canceled the dialog.
return
#("StringRight", "LastChar", "Folder", "1")
if LastChar = \
StringTrimRight, Folder, Folder, 1 ; Remove the trailing backslash.
VarSetCapacity(Filename, 260),sfi_size:=352,VarSetCapacity(sfi, sfi_size),#("GuiControl", "-Redraw", "MyListView")
Loop %Folder%\*.*
{
FileName:=A_LoopFileFullPath,#("SplitPath", "FileName","","", "FileExt")
if FileExt in EXE,ICO,ANI,CUR
ExtID:=FileExt,IconNumber = 0
else ; Some other extension/file-type, so calculate its unique ID.
{
ExtID = 0 ; Initialize to handle extensions that are shorter than others.
Loop 7 ; Limit the extension to 7 characters so that it fits in a 64-bit value.
{
StringMid, ExtChar, FileExt, A_Index, 1
if not ExtChar ; No more characters.
break
; Derive a Unique ID by assigning a different bit position to each character:
ExtID := ExtID | (Asc(ExtChar) << (8 * (A_Index - 1)))
}
; Check if this file extension already has an icon in the ImageLists. If it does,
; several calls can be avoided and loading performance is greatly improved,
; especially for a folder containing hundreds of files:
IconNumber := IconArray%ExtID%
}
if not IconNumber ; There is not yet any icon for this extension, so load it.
{
; Get the high-quality small-icon associated with this file extension:
if not DllCall("Shell32\SHGetFileInfoA", "str", FileName, "uint", 0, "str", sfi, "uint", sfi_size, "uint", 0x101) ; 0x101 is SHGFI_ICON+SHGFI_SMALLICON
IconNumber = 9999999 ; Set it out of bounds to display a blank icon.
else ; Icon successfully loaded.
{
; Extract the hIcon member from the structure:
hIcon = 0
Loop 4
hIcon += *(&sfi + A_Index-1) << 8*(A_Index-1)
; Add the HICON directly to the small-icon and large-icon lists.
; Below uses +1 to convert the returned index from zero-based to one-based:
IconNumber:=(DllCall("ImageList_ReplaceIcon", "uint", ImageListID1, "int", -1, "uint", hIcon) + 1),DllCall("ImageList_ReplaceIcon", "uint", ImageListID2, "int", -1, "uint", hIcon),DllCall("DestroyIcon", "uint", hIcon),IconArray%ExtID%:=IconNumber
}
}
; Create the new row in the ListView and assign it the icon number determined above:
LV_Add("Icon" . IconNumber, A_LoopFileName, A_LoopFileDir, A_LoopFileSizeKB, FileExt)
}
#("GuiControl", "+Redraw", "MyListView"),LV_ModifyCol(),LV_ModifyCol(3, 60)
return
ButtonClear:
#("Gui", "3:Default")
LV_Delete() ; Clear the ListView, but keep icon cache intact for simplicity.
return
ButtonSwitchView:
#("Gui", "3:Default")
if not IconView
GuiControl, +Icon, MyListView ; Switch to icon view.
else
GuiControl, +Report, MyListView ; Switch back to details view.
IconView := not IconView ; Invert in preparation for next time.
return
MyListView:
#("Gui", "3:Default")
if A_GuiEvent = DoubleClick ; There are many other possible values the script can check.
{
LV_GetText(FileName, A_EventInfo, 1),LV_GetText(FileDir, A_EventInfo, 2),#("Run", FileDir "\" FileName,"", "UseErrorLevel")
if ErrorLevel
MsgBox Could not open "%FileDir%\%FileName%".
}
return
GuiContextMenu: ; Launched in response to a right-click or press of the Apps key.
#("Gui", "3:Default")
if A_GuiControl <> MyListView ; Display the menu only for clicks inside the ListView.
return
; Show the menu at the provided coordinates, A_GuiX and A_GuiY. These should be used
; because they provide correct coordinates even if the user pressed the Apps key:
Menu, MyContextMenu, Show, %A_GuiX%, %A_GuiY%
return
ContextOpenFile: ; The user selected "Open" in the context menu.
ContextProperties: ; The user selected "Properties" in the context menu.
; For simplicitly, operate upon only the focused row rather than all selected rows:
#("Gui", "3:Default")
FocusedRowNumber := LV_GetNext(0, "F") ; Find the focused row.
if not FocusedRowNumber ; No row is focused.
return
LV_GetText(FileName, FocusedRowNumber, 1),LV_GetText(FileDir, FocusedRowNumber, 2)
IfInString A_ThisMenuItem, Open ; User selected "Open" from the context menu.
Run %FileDir%\%FileName%,, UseErrorLevel
else ; User selected "Properties" from the context menu.
Run Properties "%FileDir%\%FileName%",, UseErrorLevel
if ErrorLevel
MsgBox Could not perform requested action on "%FileDir%\%FileName%".
return
ContextClearRows: ; The user selected "Clear" in the context menu.
#("Gui", "3:Default")
RowNumber = 0 ; This causes the first iteration to start the search at the top.
Loop
{
; Since deleting a row reduces the RowNumber of all other rows beneath it,
; subtract 1 so that the search includes the same row number that was previously
; found (in case adjacent rows are selected):
RowNumber := LV_GetNext(RowNumber - 1)
if not RowNumber ; The above returned zero, so there are no more selected rows.
break
LV_Delete(RowNumber) ; Clear the row from the ListView.
}
return
GuiSize: ; Expand or shrink the ListView in response to the user's resizing of the window.
#("Gui", "3:Default")
if A_EventInfo = 1 ; The window has been minimized. No action needed.
return
; Otherwise, the window has been resized or maximized. Resize the ListView to match.
GuiControl, Move, MyListView, % "W" . (A_GuiWidth - 20) . " H" . (A_GuiHeight - 40)
return
;######################################################################################
#(p1,p2="",p3="",p4="",p5="",p6="",p7="",p8="",p9="",p10="",p11="",p12="",p13="",p14="",p15="",p16="",p17="",p18="",p19="",p20=""){
global
local t, ifcount, loopcount, out, p0,count,i,remember
If IsLabel(p1)
GoTo % p1
else if IsLabel(RegExReplace(p1,"[\s`,].*")){
Loop,Parse,p1,`,%A_Space%
{
If A_LoopField=
Continue
If (remember){
p%i%.=A_LoopField
Continue
}
i++
p%i%=%A_LoopField%
If (SubStr(A_LoopField,0)="``" && remember=1)
Continue
}
Goto, %p1%
} else
Return "`tCheck Syntax:" . "`t" . p1 . "," . p2 . "," . p3 . "," . p4 . "," . p5 . "," . p6 . "," . p7
. "," . p8 . "," . p9 . "," . p10 . "," . p11 . "," . p12 . "," . p13 . "," . p14 . "," . p15 . "," . p16
. "," . p17 . "," . p18 . "," . p19 . "," . p20 "`n"
Return
Return: ;enter return value for debuging
Return A_Tab . "ErrorLevel: " . Errorlevel . "`t" . p1 . "," . p2 . "," . p3 . "," . p4 . "," . p5 . "," . p6 . "," . p7 . "," . p8 . "," . p9 . "," . p10 . "," . p11 . "," . p12 . "," . p13 . "," . p14 . "," . p15 . "," . p16 . "," . p17 . "," . p18 . "," . p19 . "," . p20 "`n"
AT:
AutoTrim:
AutoTrim, %p2%
Return
BI:
BlockInput:
BlockInput, %p2%
Return
C:
Click:
Click %p2%, %p3%, %p4%
Return
CW:
ClipWait:
ClipWait, %p2%, %p3%
Goto, Return
CTRL:
Control:
Control, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
Goto, Return
CC:
ControlClick:
ControlClick, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%
Goto, Return
CF:
ControlFocus:
ControlFocus, %p2%, %p3%, %p4%, %p5%
Goto, Return
CG:
ControlGet:
ControlGet, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%
Goto, Return
CGF:
ControlGetFocus:
ControlGetFocus, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
CGP:
ControlGetPos:
ControlGetPos, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%, %p10%
Return
CMO:
ControlMove:
ControlMove, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%, %p10%
Goto, Return
CGT:
ControlGetText:
ControlGetText, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
Goto, Return
CS:
ControlSend:
ControlSend, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
Goto, Return
CSR:
ControlSendRaw:
ControlSendRaw, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
Goto, Return
CST:
ControlSetText:
ControlSetText, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
Goto, Return
CM:
CoordMode:
CoordMode, %p2%, %p3%
Return
CR:
Critical:
Critical, %p2%
Return
DHT:
DetectHiddenText:
DetectHiddenText, %p2%
Return
DHW:
DetectHiddenWindows:
DetectHiddenWindows, %p2%
Return
D:
Drive:
Drive, %p2%, %p3%, %p4%
Goto, Return
DG:
DriveGet:
DriveGet, %p2%, %p3%,%p4%
Goto, Return
DSF:
DriveSpaceFree:
DriveSpaceFree, %p2%, %p3%
Return
ES:
EnvSet:
EnvSet, %p2%, %p3%
Goto, Return
EG:
EnvGet:
EnvGet, %p2%, %p3%
Return
EU:
EnvUpdate:
EnvUpdate
Goto, Return
ESU:
EnvSub:
EnvSub, %p2%, %p3%
Return
EA:
EnvAdd:
EnvAdd, %p2%, %p3%
Return
ED:
EnvDiv:
EnvDiv, %p2%, %p3%
Return
EM:
EnvMult:
EnvMult, %p2%, %p3%
Return
E:
Exit:
Exit, %p2%
Return
EAP:
ExitApp:
ExitApp
Return
FA:
FileAppend:
FileAppend, %p2%, %p3%
Goto, Return
FC:
FileCopy:
FileCopy, %p2%, %p3%, %p4%
Goto, Return
FCD:
FileCopyDir:
FileCopyDir, %p2%, %p3%, %p4%
Goto, Return
FCDIR:
FileCreateDir:
FileCreateDir, %p2%
Goto, Return
FCS:
FileCreateShortcut:
FileCreateShortcut, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%, %p10%
Goto, Return
FD:
FileDelete:
FileDelete, %p2%
Goto, Return
FGA:
FileGetAttrib:
FileGetAttrib, %p2%, %p3%
Goto, Return
FGS:
FileGetSize:
FileGetSize, %p2%, %p3%, %p4%
Goto, Return
FGSH:
FileGetShortcut:
p3:=!p3 ? "t" : p3,p4:=!p4 ? "t" : p4,p5:=!p5 ? "t" : p5,p6:=!p6 ? "t" : p6,p7:=!p7 ? "t" : p7,p8:=!p8 ? "t" : p8,p9:=!p9 ? "t" : p9
FileGetShortcut, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%
Goto, Return
FGT:
FileGetTime:
FileGetTime, %p2%, %p3%, %p3%
Goto, Return
FGV:
FileGetVersion:
FileGetVersion, %p2%, %p3%
Goto, Return
FM:
FileMove:
FileMove, %p2%, %p3%, %p4%
Goto, Return
FMD:
FileMoveDir:
FileMoveDir, %p2%, %p3%, %p4%
Goto, Return
FR:
FileRead:
FileRead, %p2%, %p3%
Goto, Return
FRL:
FileReadLine:
FileReadLine, %p2%, %p3%, %p4%
Goto, Return
FRC:
FileRecycle:
FileRecycle, %p2%
Goto, Return
FRE:
FileRecycleEmpty:
FileRecycleEmpty, %p2%
Goto, Return
FRD:
FileRemoveDir:
FileRemoveDir, %p2%, %p3%
Goto, Return
FSF:
FileSelectFile:
FileSelectFile, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
FSD:
FileSelectFolder:
FileSelectFolder, %p2%, %p3%, %p4%, %p5%
Goto, Return
FSA:
FileSetAttrib:
FileSetAttrib, %p2%, %p3%, %p4%, %p5%
Goto, Return
FST:
FileSetTime:
FileSetTime, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
FT:
FormatTime:
FormatTime, %p2%, %p3%, %p4%
Goto, Return
GKS:
GetKeyState:
GetKeyState, %p2%, %p3%, %p4%
Return
GA:
GroupActivate:
GroupActivate, %p2%, %p3%
Return
GADD:
GroupAdd:
GroupAdd, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
Return
GCL:
GroupClose:
GroupClose, %p2%, %p3%
Return
H:
Hotkey:
Hotkey, %p2%, %p3%, %p4%
Goto, Return
GS:
GoSub:
GoSub, %p2%
Return
GT:
GoTo:
Goto, %p2%
Return
IMB:
IfMsgBox:
IfMsgBox, %p2%
{
count = 3
Loop 18
{
p%A_Index% := p%count%
count++
}
If IsLabel(p1)
GoSub, %p1%
}
Return
IEQ:
INEQ:
IG:
IGOE:
IL:
ILOE:
IIS:
INIS:
IWA:
IWNA:
IWE:
IWNE:
IE:
INE:
IfEqual:
IfNotEqual:
IfGreater:
IfGreaterOrEqual:
IfLess:
IfLessOrEqual:
IfInString:
IfNotInString:
IfWinActive:
IfWinNotActive:
IfWinExist:
IfWinNotExist:
IfExist:
IfNotExist:
{
loopcount=
If (p1 = "IfEqual" || p1 = "IEQ")
{
IfEqual, %p2%, %p3%
{
ifcount=4
loopcount=17
out = %p4%
p0 -= 3
}
else
Return
}
If (p1 = "IfNotEqual" || p1 = "INEQ")
{
IfNotEqual, %p2%, %p3%
{
ifcount=4
loopcount=17
out = %p4%
p0 -= 3
}
else
Return
}
If (p1 = "IfLess" || p1 = "IL")
{
IfLess, %p2%, %p3%
{
ifcount=4
loopcount=17
out = %p4%
p0 -= 3
}
else
Return
}
If (p1 = "IfLessOrEqual" || p1 = "ILOE")
{
IfLessOrEqual, %p2%, %p3%
{
ifcount=4
loopcount=17
out = %p4%
p0 -= 3
}
else
Return
}
If (p1 = "IfGreater" || p1 = "IG")
{
IfGreater, %p2%, %p3%
{
ifcount=4
loopcount=17
out = %p4%
p0 -= 3
}
else
Return
}
If (p1 = "IfGreaterOrEqual" || p1 = "IGOE")
{
IfGreaterOrEqual, %p2%, %p3%
{
ifcount=4
loopcount=17
out = %p4%
p0 -= 3
}
else
Return
}
If (p1 = "IfInString" || p1 = "IIS")
{
IfInString, %p2%, %p3%
{
ifcount=4
loopcount=17
out = %p4%
p0 -= 3
}
else
Return
}
If (p1 = "IfNotInString" || p1 = "INIS")
{
IfNotInString, %p2%, %p3%
{
ifcount=4
loopcount=17
out = %p4%
p0 -= 3
}
else
Return
}
If (p1 = "IfWinActive" || p1 = "IWA")
{
IfWinActive, %p2%, %p3%, %p4%, %p5%
{
ifcount=6
loopcount=15
out = %p6%
p0 -= 5
}
else
Return
}
If (p1 = "IfWinNotActive" || p1 = "IWNA")
{
IfWinNotActive, %p2%, %p3%, %p4%, %p5%
{
ifcount=6
loopcount=15
out = %p6%
p0 -= 5
}
else
Return
}
If (p1 = "IfWinExist" || p1 = "IWE")
{
IfWinExist, %p2%, %p3%, %p4%, %p5%
{
ifcount=6
loopcount=15
out = %p6%
p0 -= 5
}
else
Return
}
If (p1 = "IfWinNotExist" || p1 = "IWNE")
{
IfWinNotExist, %p2%, %p3%, %p4%, %p5%
{
ifcount=6
loopcount=15
out = %p6%
p0 -= 5
}
else
Return
}
If (p1 = "IfExist" || p1 = "IE")
{
IfExist, %p2%
{
ifcount=3
loopcount=18
out = %p3%
p0 -= 2
}
else
Return
}
If (p1 = "IfNotExist" || p1 = "INE")
{
IfNotExist, %p2%
{
ifcount=3
loopcount=18
out = %p3%
p0 -= 2
}
else
Return
}
Loop %loopcount%
{
p%A_Index% := p%ifcount%
ifcount++
}
out =
If loopcount =
Return
IsLabel(p1)
GoSub, %p1%
loopcount=
Return
}
KW:
KeyWait:
KeyWait, %p2%, %p3%
Goto, Return
M:
Menu:
Menu, %p2%, %p3%, %p4%, %p5%, %p6%
Return
MC:
MouseClick:
MouseClick, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%
Return
MCD:
MouseClickDrag:
MouseClickDrag, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%
Return
MGP:
MouseGetPos:
p2:=!p2 ? "t" : p2,p3:=!p3 ? "t" : p3,p4:=!p4 ? "t" : p4,p5:=!p5 ? "t" : p5
MouseGetPos, %p2%, %p3%, %p4%, %p5%, %p6%
Return
MM:
MouseMove:
MouseMove, %p2%, %p3%, %p4%, %p5%
Return
MB:
MsgBox:
checkifmsgboxfull := p3 p4 p5
IfNotEqual, checkifmsgboxfull, , SetEnv, checkifmsgboxfull, 1
If p2 is digit
{
If checkifmsgboxfull = 1
{
;MsgBox % p2
If p2 < 1
MsgBox, 0, %p3%, %p4%, %p5%
else if p2 = 1
{
MsgBox, 1, %p3%, %p4%, %p5%
}
else if p2 = 2
{
MsgBox, 2, %p3%, %p4%, %p5%
}
else if p2 = 3
{
MsgBox, 3, %p3%, %p4%, %p5%
}
else if p2 = 4
{
MsgBox, 4, %p3%, %p4%, %p5%
}
else if p2 = 5
{
MsgBox, 5, %p3%, %p4%, %p5%
}
else if p2 = 6
{
MsgBox, 6, %p3%, %p4%, %p5%
}
else if p2 = 262144
{
MsgBox, 262144, %p3%, %p4%, %p5%
}
else if p2 = 262145
{
MsgBox, 262145, %p3%, %p4%, %p5%
}
else if p2 = 262146
{
MsgBox, 262146, %p3%, %p4%, %p5%
}
else if p2 = 262147
{
MsgBox, 262147, %p3%, %p4%, %p5%
}
else if p2 = 262148
{
MsgBox, 262148, %p3%, %p4%, %p5%
}
else if p2 = 262149
{
MsgBox, 262149, %p3%, %p4%, %p5%
}
else if p2 = 262150
{
MsgBox, 262150, %p3%, %p4%, %p5%
}
}
else
{
MsgBox, %p2% %p3% %p4% %p5% %p6% %p7% %p8% %p9% %p10% %p11% %p12% %p13% %p14% %p15% %p16% %p17% %p18% %p19% %p20%
}
}
else
{
MsgBox, %p2% %p3% %p4% %p5% %p6% %p7% %p8% %p9% %p10% %p11% %p12% %p13% %p14% %p15% %p16% %p17% %p18% %p19% %p20%
}
Return
OE:
OnExit:
OnExit, %p2%
Return
PGC:
PixelGetColor:
PixelGetColor, %p2%, %p3%, %p4%, %p5%
Goto, Return
PS:
PixelSearch:
PixelSearch, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%, %p10%
Goto, Return
PWC:
PixelWaitColor: ;(ByRef p2, ByRef p3, p_x1, p_y1, p_x2, p_y2, p_color, p_shades="", p_opts="", p_waitms=0, p_checkinterval="")
{
if (RegExMatch(p8, "i)^[0-9a-f]{6}$"))
p8:="0x" p8
p8_bkp:=p8
p8:=RegExReplace(p8, "i)\bSlow\b")
if (p8=p8_bkp)
p8:=p8 " Fast"
p8_bkp:=p8
p8:=RegExReplace(p8, "i)\bBGR\b")
if (p8=p8_bkp)
p8:=p8 " RGB"
if (p12="")
p12=519
ts:=A_TickCount
Loop
{
PixelSearch, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%, %p10%
if (errorlevel=0 || p11 && A_TickCount-ts>=p11)
break
if (p11 && (A_TickCount-ts)+p12>=p11)
p12:=(p11-(A_TickCount-ts))/2
if (p12>19)
Sleep, %p12%
}
Goto, Return
}
PR:
Process:
Process, %p2%, %p3%, %p4%
Goto, Return
R:
Run:
p5:=!p5 ? "t" : p5
Run, %p2%, %p3%, %p4%,%p5%
Goto, Return
RA:
RunAs:
If p2 =
RunAs
else
RunAs, %p2%, %p3%, %p4%
Return
RW:
RunWait:
p5:=!p5 ? "t" : p5
RunWait, %p2%, %p3%, %p4%, %p5%
Goto, Return
SN:
Send:
Send, %p2%
Return
SP:
SendPlay:
SendPlay, %p2%
Return
SI:
SendInput:
SendInput, %p2%
Return
SRAW:
SendRaw:
SendRaw, %p2%
Return
SEV:
SendEvent:
SendEvent, %p2%
Return
RND:
Random:
Random, %p2%, %p3%, %p4%
Return
SE:
SetEnv:
SetEnv, %p2%, %p3%
Return
SF:
SetFormat:
SetFormat, %p2%, %p3%
Return
SMOD:
SendMode:
SendMode, %p2%
Return
SKD:
SetKeyDelay:
SetKeyDelay, %p2%, %p3%, %p4%
Return
SMD:
SetMouseDelay:
SetMouseDelay, %p2%, %p3%
Return
STMM:
SetTitleMatchMode:
SetTitleMatchMode, %p2%
Return
SWD:
SetWinDelay:
SetWinDelay, %p2%
Return
SD:
Shutdown:
Shutdown, %p2%
Return
S:
Sleep:
Sleep, %p2%
Return
SO:
Sort:
Sort, %p2%, %p3%
If p3 = U
Goto, Return
SPP:
SplitPath:
p3:=!p3 ? "t" : p3,p4:=!p4 ? "t" : p4,p5:=!p5 ? "t" : p5,p6:=!p6 ? "t" : p6,p7:=!p7 ? "t" : p7
SplitPath, %p2%,%p3%, %p4%, %p5%, %p6%, %p7%
Return
SBGT:
StatusBarGetText:
StatusBarGetText, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
Goto, Return
SBW:
StatusBarWait:
StatusBarWait, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%
Goto, Return
SCS:
StringCaseSense:
StringCaseSense, %p2%
Return
SGP:
StringGetPos:
StringGetPos, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
SL:
StringLeft:
StringLeft, %p2%, %p3%, %p4%
Return
SLEN:
StringLen:
StringLen, %p2%, %p3%
Return
SLOW:
StringLower:
StringLower, %p2%, %p3%, %p4%
Return
SM:
StringMid:
StringMid, %p2%, %p3%, %p4%, %p5%, %p6%
Return
SRPL:
StringReplace:
StringReplace, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
SR:
StringRight:
StringRight, %p2%, %p3%, %p4%
Return
SS:
StringSplit:
StringSplit, %p2%, %p3%, %p4%, %p5%
Return
STL:
StringTrimLeft:
StringTrimLeft, %p2%, %p3%, %p4%
Return
STR:
StringTrimRight:
StringTrimRight, %p2%, %p3%, %p4%
Return
SUP:
StringUpper:
StringUpper, %p2%, %p3%, %p4%
Return
SG:
SysGet:
SysGet, %p2%, %p3%, %p4%
Return
TT:
ToolTip:
ToolTip, %p2%, %p3%, %p4%, %p5%
Return
TRT:
TrayTip:
TrayTip, %p2%, %p3%, %p4%, %p5%
Return
TR:
Transform:
Transform, %p2%, %p3%, %p4%, %p5%
Return
UDTF:
UrlDownloadToFile:
UrlDownloadToFile, %p2%, %p3%
Goto, Return
VSC:
VarSetCapacity:
VarSetCapacity(%p2%, p3, p4)
Return
WA:
WinActivate:
WinActivate, %p2%, %p3%, %p4%, %p5%
Return
WAB:
WinActivateBottom:
WinActivateBottom, %p2%, %p3%, %p4%, %p5%
Return
WC:
WinClose:
WinClose, %p2%, %p3%, %p4%, %p5%, %p6%
Return
WGAT:
WinGetActiveTitle:
WinGetActiveTitle, %p2%
Return
WGC:
WinGetClass:
WinGetClass, %p2%, %p3%, %p4%, %p5%, %p6%
Return
WG:
WinGet:
WinGet, %p2%, %p3%, %p4%, %p5%, %p6%
Return
WGP:
WinGetPos:
WinGetPos, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%
Return
WGT:
WinGetText:
WinGetText, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
WGTT:
WinGetTitle:
WinGetTitle, %p2%, %p3%, %p4%, %p5%, %p6%
Return
WH:
WinHide:
WinHide, %p2%, %p3%, %p4%, %p5%
Return
WK:
WinKill:
WinKill, %p2%, %p3%, %p4%, %p5%, %p6%
Return
WMSI:
WinMenuSelectItem:
WinMenuSelectItem, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%, %p10%, %p11%, %p12%
Goto, Return
WM:
WinMove:
WinMove, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%
Return
WSH:
WinShow:
WinShow, %p2%, %p3%, %p4%, %p5%
Return
WS:
WinSet:
WinSet, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
If (p2 = "Style" or p2 = "Exstyle" or p2 = Polygon)
Goto, Return
WST:
WinSetTitle:
WinSetTitle, %p2%, %p3%, %p4%, %p5%, %p6%
Return
WW:
WinWait:
WinWait, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
WWA:
WinWaitActive:
WinWaitActive, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
WWC:
WinWaitClose:
WinWaitClose, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
WWNA:
WinWaitNotActive:
WinWaitNotActive, %p2%, %p3%, %p4%, %p5%, %p6%
Goto, Return
WMAX:
WinMaximize:
WinMaximize, %p2%, %p3%, %p4%
Return
WMIN:
WinMinimize:
WinMinimize, %p2%, %p3%, %p4%
Return
WR:
WinRestore:
WinRestore, %p2%, %p3%, %p4%, %p5%
Return
IS:
ImageSearch:
ImageSearch, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%
Goto, Return
ID:
IniDelete:
IniDelete, %p2%, %p3%, %p4%
Goto, Return
IR:
IniRead:
IniRead, %p2%, %p3%, %p4%, %p5%, %p6%
Return
IW:
IniWrite:
IniWrite, %p2%, %p3%, %p4%, %p5%
Goto, Return
I:
Input:
If p2
Input, %p2%, %p3%, %p4%, %p5%
else
Input
Goto, Return
IB:
InputBox:
InputBox, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%, , %p11%, %p12%
Goto, Return
G:
Gui:
Gui, %p2%, %p3%, %p4%, %p5%
Return
GD:
GroupDeactivate:
GroupDeactivate, %p2%, %p3%
Return
GC:
GuiControl:
GuiControl, %p2%, %p3%, %p4%
Goto, Return
GuiControlGet:
GuiControlGet, %p2%, %p3%, %p4%, %p5%
Goto, Return
If:
If p3 = is
{
If (%p2% is %p4%)
{
GoTo, RunCommand
}
}
else if p3 = is not
{
If (%p2% is not %p4%)
{
GoTo, RunCommand
}
}
else If p3 = <
{
If (%p2% < %p4%)
{
GoTo, RunCommand
}
}
else If p3 = =
{
If (%p2% = %p4%)
{
GoTo, RunCommand
}
}
else If p3 = >
{
If %p2% > %p4%
{
GoTo, RunCommand
}
}
Return
RunCommand:
count = 5
Loop 16
{
p%A_Index% := p%count%
count++
}
If IsLabel(p1)
GoTo, %p1%
Return
KH:
KeyHistory:
KeyHistory
Return
LH:
ListHotkeys:
ListHotkeys
Return
LV:
ListVars:
ListVars
Return
OD:
OutputDebug:
OutputDebug, %p2%
Return
P:
Pause:
Pause, %p2%, %p3%
Return
PM:
PostMessage:
PostMessage, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%
Goto, Return
SMSG:
SendMessage:
SendMessage, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%, %p8%, %p9%
Goto, Return
PRG:
Progress:
Progress, %p2%, %p3%, %p4%, %p5%, %p6%
Return
SIM:
SplashImage:
SplashImage, %p2%, %p3%, %p4%, %p5%, %p6%, %p7%
Return
RD:
RegDelete:
Regdelete, %p2%, %p3%, %p4%
Goto, Return
REM:
RegExMatch:
RegExMatch(%p2%, %p3%, %p4%, %p5%)
Goto, Return
RER:
RegExReplace:
RegExReplace(%p2%, %p3%, %p4%, %p5%, %p6%, %p7%)
Goto, Return
RC:
RegisterCallback:
RegisterCallback(%p2%, %p3%, %p4%, %p5%)
Return
RR:
RegRead:
RegRead, %p2%, %p3%, %p4%, %p5%
Goto, Return
RWR:
RegWrite:
RegWrite, %p2%, %p3%, %p4%, %p5%, %p6%^
Goto, Return
RL:
Reload:
Reload
Return
SBL:
SetBatchLines:
SetBatchLines, %p2%
Return
SCD:
SetControlDelay:
SetControlDelay, %p2%
Return
SDMS:
SetDefaultMouseSpeed:
SetDefaultMouseSpeed, %p2%
Return
SNLS:
SetNumLockState:
SetNumLockState, %p2%
Return
SCLS:
SetCapsLockState:
SetCapsLockState, %p2%
Return
SSLS:
SetScrollLockState:
SetScrollLockState, %p2%
Return
SSCM:
SetStoreCapslockMode:
SetStoreCapslockMode, %p2%
Return
ST:
SetTimer:
SetTimer, %p2%, %p3%, %p4%
Return
SWDIR:
SetWorkingDir:
SetWorkingDir, %p2%
Goto, Return
SB:
SoundBeep:
SoundBeep, %p2%, %p3%
Return
SOG:
SoundGet:
SoundGet, %p2%, %p3%, %p4%, %p5%
Goto, Return
SGWV:
SoundGetWaveVolume:
SoundGetWaveVolume, %p2%, %p3%, %p4%
Goto, Return
SPL:
SoundPlay:
SoundPlay, %p2%, %p3%
Goto, Return
SOS:
SoundSet:
SoundSet, %p2%, %p3%, %p4%, %p5%
Goto, Return
SSWV:
SoundSetWaveVolume:
SoundSetWaveVolume, %p2%, %p3%
Goto, Return
STOF:
SplashTextOff:
SplashTextOff
Return
STON:
SplashTextOn:
SplashTextOn, %p2%, %p3%, %p4%, %p5%
Return
SU:
Suspend:
Suspend, %p2%
Return
T:
Thread:
Thread, %p2%, %p3%
Return
WGAS:
WinGetActiveStats:
WinGetActiveStats, %p2%, %p3%, %p4%, %p5%, %p6%
Return
WMA:
WinMinimizeAll:
WinMinimizeAll
Return
WMAU:
WinMinimizeAllUndo:
WinMinimizeAllUndo
Return
} |
_________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun 
Last edited by HotKeyIt on Tue Mar 16, 2010 12:34 pm; edited 1 time in total |
|
| Back to top |
|
 |
mercx
Joined: 29 Apr 2008 Posts: 5
|
Posted: Tue Sep 15, 2009 5:53 pm Post subject: |
|
|
Though this is an old post I felt compelled to post to say, "THANK YOU!!"
This solution allowed me to complete a script for work that I have been trying to solve for a while now.
Thanks again! |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
|
| Back to top |
|
 |
Tuncay n-l-i mobile Guest
|
Posted: Tue Mar 16, 2010 1:22 pm Post subject: |
|
|
| great. Ill test it if i am home. Thx |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
Posted: Tue Mar 16, 2010 2:00 pm Post subject: |
|
|
Idea:
| Code: | x:="hallo welt"
#("msgbox %x%") |
does not work. You could use the Transform, Deref command to dereference variables.
Naming:
I would like to integrate your function into my library and republish it (with credit etc. of course). I do not like the function name "#". Is it possible that you change it to a more meaningful name. I did some time also make similiar mistake and named one of my functions to "$". Its bad style to name functions after just one special character.
I would suggest naming it to "exec()" or "cmd()" or long versions "execute()" or "command()" or may be "OLC()" or "OneLineCommand()". All these are better than "#()".
License:
Or, if you do not like, can I change the function name for republish reason? And if we are here at that point, what license uses your script? could you specify that please? Examples are user defined text about the license, or just Public Domain, or GNU LGPL and more. _________________ {1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <-- |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
Posted: Tue Mar 16, 2010 8:18 pm Post subject: |
|
|
Here we go, I'll call it Exec()
GNU GENERAL PUBLIC LICENSE
Now we can deref as much as we like, also several lines of code can be passed
Not much tested yet so please report any problems. | Code: | test=var
double=triple
one=double
var=one
Script := "MsgBox 4,Title,%test% is %var%``, %%var%%``, %%%var%%%,5`nIfMsgBox Yes,MsgBox,You pressed yes`nIfMsgBox No,MsgBox,You pressed no"
Exec(Script)
ExitApp
Exec(_#_1,_#_2="",_#_3="",_#_4="",_#_5="",_#_6="",_#_7="",_#_8="",_#_9="",_#_10="",_#_11="",_#_12="",_#_13="",_#_14="",_#_15="",_#_16="",_#_17="",_#_18="",_#_19="",_#_20=""){
global
local _#_T, _#_F, _#_L, _#_O,_#_C,_#_I,_#_P,_#_V
If IsLabel(_#_1)
GoTo % _#_1
else if IsLabel(RegExReplace(_#_1,"[\s`,].*")){
_#_I=0
Loop,Parse,_#_1,`n
{
_#_P:=RegExReplace(A_LoopField,"^(\w+)\s","$1,")
While (_#_I:=RegExMatch(_#_P,"(%[\w#@]+%)")){
_#_V:=SubStr(_#_P,_#_I+1,InStr(_#_P,"%",1,_#_I+1)-_#_I-1)
StringReplace,_#_P,_#_P,`%%_#_V%`%,% %_#_V%
_#_I++
}
Loop,Parse,_#_P,`,,%A_Space%%A_Tab%
{
If A_LoopField=
Continue
If !(_#_T){
_#_I++
_#_%_#_I% := A_LoopField
} else {
StringTrimRight,_#_%_#_I%,_#_%_#_I%,1
_#_%_#_I% .= "," A_LoopField,_#_T:=""
}
If (SubStr(A_LoopField,0)="``" && _#_T:=1)
Continue
}
_#_T:="",_#_I:=0,_#_P:=""
Gosub % _#_1
Loop 20
_#_%A_Index%=
}
} else
Return "`tCheck Syntax:" . "`t" . _#_1 . "," . _#_2 . "," . _#_3 . "," . _#_4 . "," . _#_5 . "," . _#_6 . "," . _#_7
. "," . _#_8 . "," . _#_9 . "," . _#_10 . "," . _#_11 . "," . _#_12 . "," . _#_13 . "," . _#_14 . "," . _#_15 . "," . _#_16
. "," . _#_17 . "," . _#_18 . "," . _#_19 . "," . _#_20 "`n"
Return
Return: ;enter return value for debuging
Return A_Tab . "ErrorLevel: " . Errorlevel . "`t" . _#_1 . "," . _#_2 . "," . _#_3 . "," . _#_4 . "," . _#_5 . "," . _#_6 . "," . _#_7 . "," . _#_8 . "," . _#_9 . "," . _#_10 . "," . _#_11 . "," . _#_12 . "," . _#_13 . "," . _#_14 . "," . _#_15 . "," . _#_16 . "," . _#_17 . "," . _#_18 . "," . _#_19 . "," . _#_20 "`n"
AT:
AutoTrim:
AutoTrim, %_#_2%
Return
BI:
BlockInput:
BlockInput, %_#_2%
Return
C:
Click:
Click %_#_2%, %_#_3%, %_#_4%
Return
CW:
ClipWait:
ClipWait, %_#_2%, %_#_3%
Goto, Return
CTRL:
Control:
Control, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Goto, Return
CC:
ControlClick:
ControlClick, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%
Goto, Return
CF:
ControlFocus:
ControlFocus, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
CG:
ControlGet:
ControlGet, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%
Goto, Return
CGF:
ControlGetFocus:
ControlGetFocus, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
CGP:
ControlGetPos:
ControlGetPos, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%, %_#_10%
Return
CMO:
ControlMove:
ControlMove, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%, %_#_10%
Goto, Return
CGT:
ControlGetText:
ControlGetText, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Goto, Return
CS:
ControlSend:
ControlSend, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Goto, Return
CSR:
ControlSendRaw:
ControlSendRaw, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Goto, Return
CST:
ControlSetText:
ControlSetText, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Goto, Return
CM:
CoordMode:
CoordMode, %_#_2%, %_#_3%
Return
CR:
Critical:
Critical, %_#_2%
Return
DHT:
DetectHiddenText:
DetectHiddenText, %_#_2%
Return
DHW:
DetectHiddenWindows:
DetectHiddenWindows, %_#_2%
Return
D:
Drive:
Drive, %_#_2%, %_#_3%, %_#_4%
Goto, Return
DG:
DriveGet:
DriveGet, %_#_2%, %_#_3%,%_#_4%
Goto, Return
DSF:
DriveSpaceFree:
DriveSpaceFree, %_#_2%, %_#_3%
Return
ES:
EnvSet:
EnvSet, %_#_2%, %_#_3%
Goto, Return
EG:
EnvGet:
EnvGet, %_#_2%, %_#_3%
Return
EU:
EnvUpdate:
EnvUpdate
Goto, Return
ESU:
EnvSub:
EnvSub, %_#_2%, %_#_3%
Return
EA:
EnvAdd:
EnvAdd, %_#_2%, %_#_3%
Return
ED:
EnvDiv:
EnvDiv, %_#_2%, %_#_3%
Return
EM:
EnvMult:
EnvMult, %_#_2%, %_#_3%
Return
E:
Exit:
Exit, %_#_2%
Return
EAP:
ExitApp:
ExitApp
Return
FA:
FileAppend:
FileAppend, %_#_2%, %_#_3%
Goto, Return
FC:
FileCopy:
FileCopy, %_#_2%, %_#_3%, %_#_4%
Goto, Return
FCD:
FileCopyDir:
FileCopyDir, %_#_2%, %_#_3%, %_#_4%
Goto, Return
FCDIR:
FileCreateDir:
FileCreateDir, %_#_2%
Goto, Return
FCS:
FileCreateShortcut:
FileCreateShortcut, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%, %_#_10%
Goto, Return
FD:
FileDelete:
FileDelete, %_#_2%
Goto, Return
FGA:
FileGetAttrib:
FileGetAttrib, %_#_2%, %_#_3%
Goto, Return
FGS:
FileGetSize:
FileGetSize, %_#_2%, %_#_3%, %_#_4%
Goto, Return
FGSH:
FileGetShortcut:
_#_3:=!_#_3 ? "_#_T" : _#_3,_#_4:=!_#_4 ? "_#_T" : _#_4,_#_5:=!_#_5 ? "_#_T" : _#_5,_#_6:=!_#_6 ? "_#_T" : _#_6,_#_7:=!_#_7 ? "_#_T" : _#_7,_#_8:=!_#_8 ? "_#_T" : _#_8,_#_9:=!_#_9 ? "_#_T" : _#_9
FileGetShortcut, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%
Goto, Return
FGT:
FileGetTime:
FileGetTime, %_#_2%, %_#_3%, %_#_3%
Goto, Return
FGV:
FileGetVersion:
FileGetVersion, %_#_2%, %_#_3%
Goto, Return
FM:
FileMove:
FileMove, %_#_2%, %_#_3%, %_#_4%
Goto, Return
FMD:
FileMoveDir:
FileMoveDir, %_#_2%, %_#_3%, %_#_4%
Goto, Return
FR:
FileRead:
FileRead, %_#_2%, %_#_3%
Goto, Return
FRL:
FileReadLine:
FileReadLine, %_#_2%, %_#_3%, %_#_4%
Goto, Return
FRC:
FileRecycle:
FileRecycle, %_#_2%
Goto, Return
FRE:
FileRecycleEmpty:
FileRecycleEmpty, %_#_2%
Goto, Return
FRD:
FileRemoveDir:
FileRemoveDir, %_#_2%, %_#_3%
Goto, Return
FSF:
FileSelectFile:
FileSelectFile, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
FSD:
FileSelectFolder:
FileSelectFolder, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
FSA:
FileSetAttrib:
FileSetAttrib, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
FST:
FileSetTime:
FileSetTime, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
FT:
FormatTime:
FormatTime, %_#_2%, %_#_3%, %_#_4%
Goto, Return
GKS:
GetKeyState:
GetKeyState, %_#_2%, %_#_3%, %_#_4%
Return
GA:
GroupActivate:
GroupActivate, %_#_2%, %_#_3%
Return
GADD:
GroupAdd:
GroupAdd, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Return
GCL:
GroupClose:
GroupClose, %_#_2%, %_#_3%
Return
H:
Hotkey:
Hotkey, %_#_2%, %_#_3%, %_#_4%
Goto, Return
GS:
GoSub:
GoSub, %_#_2%
Return
GT:
GoTo:
Goto, %_#_2%
Return
IMB:
IfMsgBox:
IfMsgBox, %_#_2%
{
_#_C = 3
Loop 18
{
_#_%A_Index% := _#_%_#_C%
_#_C++
}
If IsLabel(_#_1)
GoSub, %_#_1%
}
Return
IEQ:
INEQ:
IG:
IGOE:
IL:
ILOE:
IIS:
INIS:
IWA:
IWNA:
IWE:
IWNE:
IE:
INE:
IfEqual:
IfNotEqual:
IfGreater:
IfGreaterOrEqual:
IfLess:
IfLessOrEqual:
IfInString:
IfNotInString:
IfWinActive:
IfWinNotActive:
IfWinExist:
IfWinNotExist:
IfExist:
IfNotExist:
{
_#_L=
If (_#_1 = "IfEqual" || _#_1 = "IEQ")
{
IfEqual, %_#_2%, %_#_3%
{
_#_F=4
_#_L=17
_#_O = %_#_4%
_#_P -= 3
}
else
Return
}
If (_#_1 = "IfNotEqual" || _#_1 = "INEQ")
{
IfNotEqual, %_#_2%, %_#_3%
{
_#_F=4
_#_L=17
_#_O = %_#_4%
_#_P -= 3
}
else
Return
}
If (_#_1 = "IfLess" || _#_1 = "IL")
{
IfLess, %_#_2%, %_#_3%
{
_#_F=4
_#_L=17
_#_O = %_#_4%
_#_P -= 3
}
else
Return
}
If (_#_1 = "IfLessOrEqual" || _#_1 = "ILOE")
{
IfLessOrEqual, %_#_2%, %_#_3%
{
_#_F=4
_#_L=17
_#_O = %_#_4%
_#_P -= 3
}
else
Return
}
If (_#_1 = "IfGreater" || _#_1 = "IG")
{
IfGreater, %_#_2%, %_#_3%
{
_#_F=4
_#_L=17
_#_O = %_#_4%
_#_P -= 3
}
else
Return
}
If (_#_1 = "IfGreaterOrEqual" || _#_1 = "IGOE")
{
IfGreaterOrEqual, %_#_2%, %_#_3%
{
_#_F=4
_#_L=17
_#_O = %_#_4%
_#_P -= 3
}
else
Return
}
If (_#_1 = "IfInString" || _#_1 = "IIS")
{
IfInString, %_#_2%, %_#_3%
{
_#_F=4
_#_L=17
_#_O = %_#_4%
_#_P -= 3
}
else
Return
}
If (_#_1 = "IfNotInString" || _#_1 = "INIS")
{
IfNotInString, %_#_2%, %_#_3%
{
_#_F=4
_#_L=17
_#_O = %_#_4%
_#_P -= 3
}
else
Return
}
If (_#_1 = "IfWinActive" || _#_1 = "IWA")
{
IfWinActive, %_#_2%, %_#_3%, %_#_4%, %_#_5%
{
_#_F=6
_#_L=15
_#_O = %_#_6%
_#_P -= 5
}
else
Return
}
If (_#_1 = "IfWinNotActive" || _#_1 = "IWNA")
{
IfWinNotActive, %_#_2%, %_#_3%, %_#_4%, %_#_5%
{
_#_F=6
_#_L=15
_#_O = %_#_6%
_#_P -= 5
}
else
Return
}
If (_#_1 = "IfWinExist" || _#_1 = "IWE")
{
IfWinExist, %_#_2%, %_#_3%, %_#_4%, %_#_5%
{
_#_F=6
_#_L=15
_#_O = %_#_6%
_#_P -= 5
}
else
Return
}
If (_#_1 = "IfWinNotExist" || _#_1 = "IWNE")
{
IfWinNotExist, %_#_2%, %_#_3%, %_#_4%, %_#_5%
{
_#_F=6
_#_L=15
_#_O = %_#_6%
_#_P -= 5
}
else
Return
}
If (_#_1 = "IfExist" || _#_1 = "IE")
{
IfExist, %_#_2%
{
_#_F=3
_#_L=18
_#_O = %_#_3%
_#_P -= 2
}
else
Return
}
If (_#_1 = "IfNotExist" || _#_1 = "INE")
{
IfNotExist, %_#_2%
{
_#_F=3
_#_L=18
_#_O = %_#_3%
_#_P -= 2
}
else
Return
}
Loop %_#_L%
{
_#_%A_Index% := _#_%_#_F%
_#_F++
}
_#_O =
If _#_L =
Return
IsLabel(_#_1)
GoSub, %_#_1%
_#_L=
Return
}
KW:
KeyWait:
KeyWait, %_#_2%, %_#_3%
Goto, Return
M:
Menu:
Menu, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
MC:
MouseClick:
MouseClick, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%
Return
MCD:
MouseClickDrag:
MouseClickDrag, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%
Return
MGP:
MouseGetPos:
_#_2:=!_#_2 ? "_#_T" : _#_2,_#_3:=!_#_3 ? "_#_T" : _#_3,_#_4:=!_#_4 ? "_#_T" : _#_4,_#_5:=!_#_5 ? "_#_T" : _#_5
MouseGetPos, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
MM:
MouseMove:
MouseMove, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
MB:
MsgBox:
checkifmsgboxfull := _#_3 _#_4 _#_5
IfNotEqual, checkifmsgboxfull, , SetEnv, checkifmsgboxfull, 1
If _#_2 is digit
{
If checkifmsgboxfull = 1
{
;MsgBox % _#_2
If _#_2 < 1
MsgBox, 0, %_#_3%, %_#_4%, %_#_5%
else if _#_2 = 1
{
MsgBox, 1, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 2
{
MsgBox, 2, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 3
{
MsgBox, 3, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 4
{
MsgBox, 4, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 5
{
MsgBox, 5, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 6
{
MsgBox, 6, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 262144
{
MsgBox, 262144, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 262145
{
MsgBox, 262145, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 262146
{
MsgBox, 262146, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 262147
{
MsgBox, 262147, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 262148
{
MsgBox, 262148, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 262149
{
MsgBox, 262149, %_#_3%, %_#_4%, %_#_5%
}
else if _#_2 = 262150
{
MsgBox, 262150, %_#_3%, %_#_4%, %_#_5%
}
}
else
{
MsgBox, %_#_2% %_#_3% %_#_4% %_#_5% %_#_6% %_#_7% %_#_8% %_#_9% %_#_10% %_#_11% %_#_12% %_#_13% %_#_14% %_#_15% %_#_16% %_#_17% %_#_18% %_#_19% %_#_20%
}
}
else
{
MsgBox, %_#_2% %_#_3% %_#_4% %_#_5% %_#_6% %_#_7% %_#_8% %_#_9% %_#_10% %_#_11% %_#_12% %_#_13% %_#_14% %_#_15% %_#_16% %_#_17% %_#_18% %_#_19% %_#_20%
}
Return
OE:
OnExit:
OnExit, %_#_2%
Return
PGC:
PixelGetColor:
PixelGetColor, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
PS:
PixelSearch:
PixelSearch, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%, %_#_10%
Goto, Return
PWC:
PixelWaitColor: ;(ByRef _#_2, ByRef _#_3, p_x1, p_y1, p_x2, p_y2, p_color, p_shades="", p_opts="", p_waitms=0, p_checkinterval="")
{
if (RegExMatch(_#_8, "i)^[0-9a-f]{6}$"))
_#_8:="0x" _#_8
_#_8_bkp:=_#_8
_#_8:=RegExReplace(_#_8, "i)\bSlow\b")
if (_#_8=_#_8_bkp)
_#_8:=_#_8 " Fast"
_#_8_bkp:=_#_8
_#_8:=RegExReplace(_#_8, "i)\bBGR\b")
if (_#_8=_#_8_bkp)
_#_8:=_#_8 " RGB"
if (_#_12="")
_#_12=519
ts:=A_TickCount
Loop
{
PixelSearch, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%, %_#_10%
if (errorlevel=0 || _#_11 && A_TickCount-ts>=_#_11)
break
if (_#_11 && (A_TickCount-ts)+_#_12>=_#_11)
_#_12:=(_#_11-(A_TickCount-ts))/2
if (_#_12>19)
Sleep, %_#_12%
}
Goto, Return
}
PR:
Process:
Process, %_#_2%, %_#_3%, %_#_4%
Goto, Return
R:
Run:
_#_5:=!_#_5 ? "_#_T" : _#_5
Run, %_#_2%, %_#_3%, %_#_4%,%_#_5%
Goto, Return
RA:
RunAs:
If _#_2 =
RunAs
else
RunAs, %_#_2%, %_#_3%, %_#_4%
Return
RW:
RunWait:
_#_5:=!_#_5 ? "_#_T" : _#_5
RunWait, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
SN:
Send:
Send, %_#_2%
Return
SP:
SendPlay:
SendPlay, %_#_2%
Return
SI:
SendInput:
SendInput, %_#_2%
Return
SRAW:
SendRaw:
SendRaw, %_#_2%
Return
SEV:
SendEvent:
SendEvent, %_#_2%
Return
RND:
Random:
Random, %_#_2%, %_#_3%, %_#_4%
Return
SE:
SetEnv:
SetEnv, %_#_2%, %_#_3%
Return
SF:
SetFormat:
SetFormat, %_#_2%, %_#_3%
Return
SMOD:
SendMode:
SendMode, %_#_2%
Return
SKD:
SetKeyDelay:
SetKeyDelay, %_#_2%, %_#_3%, %_#_4%
Return
SMD:
SetMouseDelay:
SetMouseDelay, %_#_2%, %_#_3%
Return
STMM:
SetTitleMatchMode:
SetTitleMatchMode, %_#_2%
Return
SWD:
SetWinDelay:
SetWinDelay, %_#_2%
Return
SD:
Shutdown:
Shutdown, %_#_2%
Return
S:
Sleep:
Sleep, %_#_2%
Return
SO:
Sort:
Sort, %_#_2%, %_#_3%
If _#_3 = U
Goto, Return
SPP:
SplitPath:
_#_3:=!_#_3 ? "_#_T" : _#_3,_#_4:=!_#_4 ? "_#_T" : _#_4,_#_5:=!_#_5 ? "_#_T" : _#_5,_#_6:=!_#_6 ? "_#_T" : _#_6,_#_7:=!_#_7 ? "_#_T" : _#_7
SplitPath, %_#_2%,%_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Return
SBGT:
StatusBarGetText:
StatusBarGetText, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Goto, Return
SBW:
StatusBarWait:
StatusBarWait, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%
Goto, Return
SCS:
StringCaseSense:
StringCaseSense, %_#_2%
Return
SGP:
StringGetPos:
StringGetPos, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
SL:
StringLeft:
StringLeft, %_#_2%, %_#_3%, %_#_4%
Return
SLEN:
StringLen:
StringLen, %_#_2%, %_#_3%
Return
SLOW:
StringLower:
StringLower, %_#_2%, %_#_3%, %_#_4%
Return
SM:
StringMid:
StringMid, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
SRPL:
StringReplace:
StringReplace, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
SR:
StringRight:
StringRight, %_#_2%, %_#_3%, %_#_4%
Return
SS:
StringSplit:
StringSplit, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
STL:
StringTrimLeft:
StringTrimLeft, %_#_2%, %_#_3%, %_#_4%
Return
STR:
StringTrimRight:
StringTrimRight, %_#_2%, %_#_3%, %_#_4%
Return
SUP:
StringUpper:
StringUpper, %_#_2%, %_#_3%, %_#_4%
Return
SG:
SysGet:
SysGet, %_#_2%, %_#_3%, %_#_4%
Return
TT:
ToolTip:
ToolTip, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
TRT:
TrayTip:
TrayTip, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
TR:
Transform:
Transform, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
UDTF:
UrlDownloadToFile:
UrlDownloadToFile, %_#_2%, %_#_3%
Goto, Return
VSC:
VarSetCapacity:
VarSetCapacity(%_#_2%, _#_3, _#_4)
Return
WA:
WinActivate:
WinActivate, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
WAB:
WinActivateBottom:
WinActivateBottom, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
WC:
WinClose:
WinClose, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
WGAT:
WinGetActiveTitle:
WinGetActiveTitle, %_#_2%
Return
WGC:
WinGetClass:
WinGetClass, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
WG:
WinGet:
WinGet, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
WGP:
WinGetPos:
WinGetPos, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%
Return
WGT:
WinGetText:
WinGetText, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
WGTT:
WinGetTitle:
WinGetTitle, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
WH:
WinHide:
WinHide, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
WK:
WinKill:
WinKill, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
WMSI:
WinMenuSelectItem:
WinMenuSelectItem, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%, %_#_10%, %_#_11%, %_#_12%
Goto, Return
WM:
WinMove:
WinMove, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%
Return
WSH:
WinShow:
WinShow, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
WS:
WinSet:
WinSet, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
If (_#_2 = "Style" or _#_2 = "Exstyle" or _#_2 = Polygon)
Goto, Return
WST:
WinSetTitle:
WinSetTitle, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
WW:
WinWait:
WinWait, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
WWA:
WinWaitActive:
WinWaitActive, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
WWC:
WinWaitClose:
WinWaitClose, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
WWNA:
WinWaitNotActive:
WinWaitNotActive, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Goto, Return
WMAX:
WinMaximize:
WinMaximize, %_#_2%, %_#_3%, %_#_4%
Return
WMIN:
WinMinimize:
WinMinimize, %_#_2%, %_#_3%, %_#_4%
Return
WR:
WinRestore:
WinRestore, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
IS:
ImageSearch:
ImageSearch, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%
Goto, Return
ID:
IniDelete:
IniDelete, %_#_2%, %_#_3%, %_#_4%
Goto, Return
IR:
IniRead:
IniRead, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
IW:
IniWrite:
IniWrite, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
I:
Input:
If _#_2
Input, %_#_2%, %_#_3%, %_#_4%, %_#_5%
else
Input
Goto, Return
IB:
InputBox:
InputBox, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%, , %_#_11%, %_#_12%
Goto, Return
G:
Gui:
Gui, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
GD:
GroupDeactivate:
GroupDeactivate, %_#_2%, %_#_3%
Return
GC:
GuiControl:
GuiControl, %_#_2%, %_#_3%, %_#_4%
Goto, Return
GuiControlGet:
GuiControlGet, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
If:
If _#_3 = is
{
If (%_#_2% is %_#_4%)
{
GoTo, RunCommand
}
}
else if _#_3 = is not
{
If (%_#_2% is not %_#_4%)
{
GoTo, RunCommand
}
}
else If _#_3 = <
{
If (%_#_2% < %_#_4%)
{
GoTo, RunCommand
}
}
else If _#_3 = =
{
If (%_#_2% = %_#_4%)
{
GoTo, RunCommand
}
}
else If _#_3 = >
{
If %_#_2% > %_#_4%
{
GoTo, RunCommand
}
}
Return
RunCommand:
_#_C = 5
Loop 16
{
_#_%A_Index% := _#_%_#_C%
_#_C++
}
If IsLabel(_#_1)
GoTo, %_#_1%
Return
KH:
KeyHistory:
KeyHistory
Return
LH:
ListHotkeys:
ListHotkeys
Return
LV:
ListVars:
ListVars
Return
OD:
OutputDebug:
OutputDebug, %_#_2%
Return
P:
Pause:
Pause, %_#_2%, %_#_3%
Return
PM:
PostMessage:
PostMessage, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%
Goto, Return
SMSG:
SendMessage:
SendMessage, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%, %_#_8%, %_#_9%
Goto, Return
PRG:
Progress:
Progress, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
SIM:
SplashImage:
SplashImage, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%
Return
RD:
RegDelete:
Regdelete, %_#_2%, %_#_3%, %_#_4%
Goto, Return
REM:
RegExMatch:
RegExMatch(%_#_2%, %_#_3%, %_#_4%, %_#_5%)
Goto, Return
RER:
RegExReplace:
RegExReplace(%_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%, %_#_7%)
Goto, Return
RC:
RegisterCallback:
RegisterCallback(%_#_2%, %_#_3%, %_#_4%, %_#_5%)
Return
RR:
RegRead:
RegRead, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
RWR:
RegWrite:
RegWrite, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%^
Goto, Return
RL:
Reload:
Reload
Return
SBL:
SetBatchLines:
SetBatchLines, %_#_2%
Return
SCD:
SetControlDelay:
SetControlDelay, %_#_2%
Return
SDMS:
SetDefaultMouseSpeed:
SetDefaultMouseSpeed, %_#_2%
Return
SNLS:
SetNumLockState:
SetNumLockState, %_#_2%
Return
SCLS:
SetCapsLockState:
SetCapsLockState, %_#_2%
Return
SSLS:
SetScrollLockState:
SetScrollLockState, %_#_2%
Return
SSCM:
SetStoreCapslockMode:
SetStoreCapslockMode, %_#_2%
Return
ST:
SetTimer:
SetTimer, %_#_2%, %_#_3%, %_#_4%
Return
SWDIR:
SetWorkingDir:
SetWorkingDir, %_#_2%
Goto, Return
SB:
SoundBeep:
SoundBeep, %_#_2%, %_#_3%
Return
SOG:
SoundGet:
SoundGet, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
SGWV:
SoundGetWaveVolume:
SoundGetWaveVolume, %_#_2%, %_#_3%, %_#_4%
Goto, Return
SPL:
SoundPlay:
SoundPlay, %_#_2%, %_#_3%
Goto, Return
SOS:
SoundSet:
SoundSet, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Goto, Return
SSWV:
SoundSetWaveVolume:
SoundSetWaveVolume, %_#_2%, %_#_3%
Goto, Return
STOF:
SplashTextOff:
SplashTextOff
Return
STON:
SplashTextOn:
SplashTextOn, %_#_2%, %_#_3%, %_#_4%, %_#_5%
Return
SU:
Suspend:
Suspend, %_#_2%
Return
T:
Thread:
Thread, %_#_2%, %_#_3%
Return
WGAS:
WinGetActiveStats:
WinGetActiveStats, %_#_2%, %_#_3%, %_#_4%, %_#_5%, %_#_6%
Return
WMA:
WinMinimizeAll:
WinMinimizeAll
Return
WMAU:
WinMinimizeAllUndo:
WinMinimizeAllUndo
Return
} |
_________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun 
Last edited by HotKeyIt on Fri Mar 19, 2010 5:29 am; edited 2 times in total |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
Posted: Thu Mar 18, 2010 9:55 am Post subject: |
|
|
Thx for the changes. Another thing to mention is may be not possible: The variables are dereferenced from global space. For such a function, that is may be ok. It would be perfect if it dereferences in functions scope, but I have no idea how this would be possible, if ever (LowLevel.ahk?).
The example shows it has accsess to internal variables and the comma is not shown:
| Code: | test=var
double=triple
one=double
var=one
f()
ExitApp
f()
{
one = test
Script := "msgbox, %one%,`, %_#_2%"
Exec(Script, "hello")
} |
The next example script crashes, it tries to accsess the first parameter:
| Code: | f()
ExitApp
f()
{
Script := "msgbox, %_#_1%"
Exec(Script, "hello")
} |
Next code also dont work:
| Code: | f()
ExitApp
f()
{
Script := "setenv, var, hello`nmsgbox, %var%"
Exec(Script)
} |
Another thing it does not support are creating static vars:
| Code: | f()
ExitApp
f()
{
Script := "static var`nvar=13"
Exec(Script)
Script := "msgbox %var%"
Exec(Script)
} |
I know it is too much, but I think it is important to know all that. _________________ {1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <-- |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
Posted: Thu Mar 18, 2010 6:28 pm Post subject: |
|
|
| Tuncay wrote: | | Thx for the changes. Another thing to mention is may be not possible: The variables are dereferenced from global space. For such a function, that is may be ok. It would be perfect if it dereferences in functions scope, but I have no idea how this would be possible, if ever (LowLevel.ahk?). | Unfortunately not possible, so must use global variables and Labels instead functions.
| Tuncay wrote: |
The example shows it has accsess to internal variables and the comma is not shown:...
The next example script crashes, it tries to accsess the first parameter:
... | I have called the variables that way to make it less probably that these are used by the user. You should not access them, this will mostly not work and confuse
| Tuncay wrote: | Next code also dont work:
| Code: | f()
ExitApp
f()
{
Script := "setenv, var, hello`nmsgbox, %var%"
Exec(Script)
} |
| Fixed, try above again.
| Tuncay wrote: | | Another thing it does not support are creating static vars: | Will not work, it would be possible using LowLevel but would create a static variable inside that function and I am not sure if and how this could be much of use.
AutoHotkey.dll is defenitely the way to go if you want everything to work  _________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun  |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
Posted: Thu Mar 18, 2010 7:28 pm Post subject: |
|
|
| Quote: | | Will not work, it would be possible using LowLevel but would create a static variable inside that function and I am not sure if and how this could be much of use. |
My thought was to remember variables for different Exec() calls avoiding globals.
I appreciate your work on this functions, thanks. In some situations it will come handy. _________________ {1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <-- |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Fri Mar 19, 2010 12:39 am Post subject: |
|
|
Very nice!
One thing I found is that you cannot use something like MsgBox Hello (only space), you must use: MsgBox, , , Hello. Same with Sleep, 2000 instead of Sleep 2000 etc. |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|