[Hotstrings] Expand parameters for AHK's functions, commands and directives.

Discuss features, issues, about Editors for AHK
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

[Hotstrings] Expand parameters for AHK's functions, commands and directives.

07 Feb 2017, 12:33

Introduction
These are circa three hundred, ready-to-use hotstrings for expanding AHK's built-in functions, commands and directives. Also try this nice script by boiler: Insert AHK Command/Function Parameters (with Search/Auto-Complete).

Download
ahkHotstrings.ahk
(18.24 KiB) Downloaded 2824 times
How to use
Type a function/command and press tab to expand its parameters,
Preview
Some commands and functions can be called in more than one way, these parameters can be cycled with tab, eg,
Preview
I reccomend making all hotstrings context sensitive for your editor, eg

Code: Select all

#IfWinActive, ahk_exe notepad++.exe
Known issues and limitations
  • Very limited testing.
  • AutoGUI users will have more luck using Insert AHK Command/Function Parameters (with Search/Auto-Complete) by boiler. Edit: AutoGUI has similar built-in features, see this comment.
  • To enable the cycling, #InputLevel,1 is used for the hotstrings.
  • May lack some relevant hotstrings.
  • May contain some irrelevant hotstrings.
  • I choose not to expand output variables.
  • Hotstring option ? is not present on functions that should follow an object-dot, eg, File.RawRead(...). This might be changed. You are welcome to do it for me ;)
Missing hotstrings, add if desired:

Code: Select all

:OB0:StrSplit::(String [, Delimiters, OmitChars])
:OB0:StrReplace::(Haystack, SearchText [, ReplaceText, OutputVarCount, Limit := -1])
Credits
All credit goes to forum member jeeswg for generating this list which I have reduced to this,

Code: Select all

Number := Asc(String)
AutoTrim, On|Off
BlockInput, Mode
Break [, LoopLabel]
String := Chr(Number)
ClipWait [, SecondsToWait, 1]
ComObject := ComObjActive(CLSID)
ParamObj := ComObject(VarType, Value [, Flags])
ParamObj := ComObjMissing()
ComObject := ComObjEnwrap(DispPtr)
DispPtr := ComObjUnwrap(ComObject)
ArrayObj := ComObjArray(VarType, Count1 [, Count2, ... Count8])
ComObjConnect(ComObject [, Prefix])
ComObject := ComObjCreate(CLSID [, IID])
Enabled := ComObjError([Enable])
Flags := ComObjFlags(ComObject [, NewFlags, Mask])
ComObject := ComObjGet(Name)
InterfacePointer := ComObjQuery(ComObject, [SID,] IID)
VarType := ComObjType(ComObject)
Name    := ComObjType(ComObject, "Name")
IID     := ComObjType(ComObject, "IID")
Value := ComObjValue(ComObject)
Continue [, LoopLabel]
Control, Cmd [, Value, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]
ControlFocus [, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlGet, OutputVar, Cmd [, Value, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlGetFocus, OutputVar [, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlGetPos [, X, Y, Width, Height, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlGetText, OutputVar [, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlMove, Control, X, Y, Width, Height [, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlSend [, Control, Keys, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlSendRaw: Same parameters as above.
ControlSetText [, Control, NewText, WinTitle, WinText, ExcludeTitle, ExcludeText]
CoordMode, ToolTip|Pixel|Mouse|Caret|Menu [, Screen|Window|Client]
Critical [, Off]
Critical 50 ; See bottom of remarks.
DetectHiddenText, On|Off
DetectHiddenWindows, On|Off
Result := DllCall("[DllFile\]Function" [, Type1, Arg1, Type2, Arg2, "Cdecl ReturnType"])
Drive, Sub-command [, Drive , Value]
DriveGet, OutputVar, Cmd [, Value]
DriveSpaceFree, OutputVar, Path
Edit
Else
EnvAdd, Var, Value [, TimeUnits]
EnvDiv, Var, Value
EnvGet, OutputVar, EnvVarName
EnvMult, Var, Value
EnvSet, EnvVar, Value
EnvSub, Var, Value [, TimeUnits]
EnvUpdate
Exit [, ExitCode]
ExitApp [, ExitCode]
FileAppend [, Text, Filename, Encoding]
FileCopy, SourcePattern, DestPattern [, Flag]
FileCopyDir, Source, Dest [, Flag]
FileCreateDir, DirName
FileCreateShortcut, Target, LinkFile [, WorkingDir, Args, Description, IconFile, ShortcutKey, IconNumber, RunState]
FileDelete, FilePattern
FileEncoding [, Encoding]
AttributeString := FileExist(FilePattern)
FileGetAttrib, OutputVar [, Filename]
AttributeString := FileExist(FilePattern)
FileGetShortcut, LinkFile [, OutTarget, OutDir, OutArgs, OutDescription, OutIcon, OutIconNum, OutRunState]
FileGetSize, OutputVar [, Filename, Units]
FileGetTime, OutputVar [, Filename, WhichTime]
FileGetVersion, OutputVar [, Filename]
FileInstall, Source, Dest [, Flag]
FileMove, SourcePattern, DestPattern [, Flag]
FileMoveDir, Source, Dest [, Flag]
file := FileOpen(Filename, Flags [, Encoding])
FileRead, OutputVar, Filename
FileReadLine, OutputVar, Filename, LineNum
FileRecycle, FilePattern
FileRecycleEmpty [, DriveLetter]
FileRemoveDir, DirName [, Recurse?]
FileSelectFile, OutputVar [, Options, RootDir\Filename, Prompt, Filter]
FileSelectFolder, OutputVar [, StartingFolder, Options, Prompt]
FileSetAttrib, Attributes [, FilePattern, OperateOnFolders?, Recurse?]
FileSetTime [, YYYYMMDDHH24MISS, FilePattern, WhichTime, OperateOnFolders?, Recurse?]
Finally Statement
For Key [, Value] in Expression
String := Format(FormatStr [, Values...])
Flags Width .Precision ULT Type
FormatTime, OutputVar [, YYYYMMDDHH24MISS, Format]
FunctionReference := Func(FunctionName)
String := GetKeyName(Key)
Number := GetKeyVK(Key)
Number := GetKeySC(Key)
GetKeyState, OutputVar, KeyName [, Mode]
KeyIsDown := GetKeyState("KeyName" [, "Mode"])
Gosub, Label
Goto, Label
GroupActivate, GroupName [, R]
GroupAdd, GroupName [, WinTitle, WinText, Label, ExcludeTitle, ExcludeText]
GroupClose, GroupName [, A|R]
GroupDeactivate, GroupName [, R]
Gui, sub-command [, Param2, Param3, Param4]
CtrlEvent(CtrlHwnd, GuiEvent, EventInfo, ErrorLevel:="")
GuiSize(GuiHwnd, EventInfo, Width, Height)
GuiContextMenu(GuiHwnd, CtrlHwnd, EventInfo, IsRightClick, X, Y)
GuiControl, Sub-command, ControlID [, Param3]
GuiControlGet, OutputVar [, Sub-command, ControlID, Param4]
Hotkey, KeyName [, Label, Options]
Hotkey, IfWinActive/Exist [, WinTitle, WinText]
Hotkey, If [, Expression]
if Var between LowerBound and UpperBound
if Var not between LowerBound and UpperBound
IfEqual, var, value
IfNotEqual, var, value
IfGreater, var, value
IfGreaterOrEqual, var, value
IfLess, var, value
IfLessOrEqual, var, value
If var ; If var's contents are blank or 0, it is considered false. Otherwise, it is true.
IfExist, FilePattern
IfNotExist, FilePattern
AttributeString := FileExist(FilePattern)
if (expression)
if Var in MatchList
if Var not in MatchList
if Var contains MatchList
if Var not contains MatchList
IfInString, var, SearchString
IfNotInString, var, SearchString
Position := InStr(Haystack, Needle [, CaseSensitive?, StartingPos]]) ; See the InStr() function for details.
if var is type
if var is not type
IfMsgBox, ButtonName
ImageSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ImageFile
IniDelete, Filename, Section [, Key]
IniRead, OutputVar, Filename, Section, Key [, Default]
IniRead, OutputVarSection, Filename, Section
IniRead, OutputVarSectionNames, Filename
IniWrite, Value, Filename, Section, Key
IniWrite, Pairs, Filename, Section
Input [, OutputVar, Options, EndKeys, MatchList]
InputBox, OutputVar [, Title, Prompt, HIDE, Width, Height, X, Y, Font, Timeout, Default]
FoundPos := InStr(Haystack, Needle [, CaseSensitive = false, StartingPos = 1, Occurrence = 1])
TrueOrFalse := IsByRef(UnquotedVarName)
MinParamsPlus1 := IsFunc(FunctionName)
TrueOrFalse := IsLabel(LabelName)
TrueOrFalse := IsObject(ObjectValue)
KeyHistory
KeyWait, KeyName [, Options]
ListHotkeys
ListLines [, On|Off]
ListVars
Handle := LoadPicture(Filename [, Options, ByRef ImageType])
Loop [, Count]
Loop, Files, FilePattern [, Mode]
Loop, FilePattern [, IncludeFolders?, Recurse?]
Loop, Parse, InputVar [, Delimiters, OmitChars]
Loop, Read, InputFile [, OutputFile]
Loop, Reg, RootKey[\Key, Mode]
Loop, RootKey [, Key, IncludeSubkeys?, Recurse?]
Value := Abs(Number)
Value := Ceil(Number)
Value := Exp(N)
Value := Floor(Number)
Value := Log(Number)
Value := Ln(Number)
Value := Mod(Dividend, Divisor)
Value := Round(Number [, N])
Value := Sqrt(Number)
Value := Sin(Number)
Value := Cos(Number)
Value := Tan(Number)
Value := ASin(Number)
Value := ACos(Number)
Value := ATan(Number)
Menu, MenuName, Cmd [, P3, P4, P5]
Handle := MenuGetHandle(MenuName)
MenuName := MenuGetName(Handle)
MouseClick [, WhichButton , X, Y, ClickCount, Speed, D|U, R]
MouseClickDrag, WhichButton, X1, Y1, X2, Y2 [, Speed, R]
MouseGetPos, [OutputVarX, OutputVarY, OutputVarWin, OutputVarControl, 1|2|3]
MouseMove, X, Y [, Speed, R]
MsgBox, Text
MsgBox [, Options, Title, Text, Timeout]
Number := NumGet(VarOrAddress [, Offset = 0][, Type = "UPtr"])
NumPut(Number, VarOrAddress [, Offset = 0][, Type = "UPtr"])
ObjAddRef(Ptr)
ObjRelease(Ptr)
BoundFunc := ObjBindMethod(Obj, Method, Params)
OnClipboardChange(Func [, AddRemove])
OnExit [, Label]
OnExit(Func [, AddRemove])  ; Requires [v1.1.20+]
ExitFunc(ExitReason, ExitCode)
OnMessage(MsgNumber [, Function, MaxThreads])
Name := OnMessage(MsgNumber, "FunctionName")
Name := OnMessage(MsgNumber, "")
Name := OnMessage(MsgNumber)
OnMessage(MsgNumber, FuncObj)     ; Option 1
OnMessage(MsgNumber, FuncObj, 1)  ; Option 2 (MaxThreads = 1)
OnMessage(MsgNumber, FuncObj, -1)
OnMessage(MsgNumber, FuncObj, 0)
Number := Ord(String)
OutputDebug, Text
Pause [, On|Off|Toggle, OperateOnUnderlyingThread?]
PixelGetColor, OutputVar, X, Y [, Alt|Slow|RGB]
PixelSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ColorID [, Variation, Fast|RGB]
PostMessage, Msg [, wParam, lParam, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
SendMessage, Msg [, wParam, lParam, Control, WinTitle, WinText, ExcludeTitle, ExcludeText, Timeout]
Process, Cmd [, PID-or-Name, Param3]
SplashImage, Off
SplashImage [, ImageFile, Options, SubText, MainText, WinTitle, FontName]
Progress, Off
Progress, ProgressParam1 [, SubText, MainText, WinTitle, FontName]
Random, OutputVar [, Min, Max]
Random, , NewSeed
RegDelete, RootKey\SubKey [, ValueName]  ; v1.1.21+
RegDelete, RootKey, SubKey [, ValueName]
FoundPos := RegExMatch(Haystack, NeedleRegEx [, UnquotedOutputVar = "", StartingPosition = 1])
NewStr := RegExReplace(Haystack, NeedleRegEx [, Replacement = "", OutputVarCount = "", Limit = -1, StartingPosition = 1])
Address := RegisterCallback("FunctionName" [, Options = "", ParamCount = FormalCount, EventInfo = Address])
RegRead, OutputVar, RootKey\SubKey [, ValueName]  ; v1.1.21+
RegRead, OutputVar, RootKey, SubKey [, ValueName]
RegWrite, ValueType, RootKey\SubKey [, ValueName, Value]  ; v1.1.21+
RegWrite, ValueType, RootKey, SubKey [, ValueName, Value]
Reload
Return [, Expression]
FileRead, OutputVar, *Pnnn Filename
Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
RunWait, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
RunAs [, User, Password, Domain]
Send Keys
SendRaw Keys
SendInput Keys
SendPlay Keys
SendEvent Keys
SendLevel, Level
SendMode Input|Play|Event|InputThenPlay
SetBatchLines, 20ms
SetBatchLines, LineCount
SetControlDelay, Delay
SetDefaultMouseSpeed, Speed
SetEnv, Var, Value
SetFormat, NumberType, Format
SetKeyDelay [, Delay, PressDuration, Play]
SetMouseDelay, Delay [, Play]
SetCapsLockState [, State]
SetNumLockState [, State]
SetScrollLockState [, State]
SetRegView, RegView
SetStoreCapslockMode, On|Off
SetTimer [, Label, Period|On|Off|Delete, Priority]
SetTitleMatchMode, MatchMode
SetTitleMatchMode, Fast|Slow
SetWinDelay, Delay
SetWorkingDir, DirName
Shutdown, Code
Sleep, DelayInMilliseconds
Sort, VarName [, Options]
SoundBeep [, Frequency, Duration]
SoundGet, OutputVar [, ComponentType, ControlType, DeviceNumber]
SoundGetWaveVolume, OutputVar [, DeviceNumber]
SoundPlay, Filename [, wait]
SoundSet, NewSetting [, ComponentType, ControlType, DeviceNumber]
SoundSetWaveVolume, Percent [, DeviceNumber]
SplashTextOff
SplashTextOn [, Width, Height, Title, Text]
SplitPath, InputVar [, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive]
StatusBarGetText, OutputVar [, Part#, WinTitle, WinText, ExcludeTitle, ExcludeText]
StatusBarWait [, BarText, Seconds, Part#, WinTitle, WinText, Interval, ExcludeTitle, ExcludeText]
StringCaseSense, On|Off|Locale
StringGetPos, OutputVar, InputVar, SearchText [, L#|R#, Offset]
Position := InStr(Haystack, Needle [, CaseSensitive?, StartingPos]) ; See the InStr() function for details.
StringLeft, OutputVar, InputVar, Count
StringRight, OutputVar, InputVar, Count
NewStr := SubStr(String, StartPos [, Length]) ; See the SubStr() function for details.
OutputVar := StrLen(InputVar)
StringLen, OutputVar, InputVar
StringLower, OutputVar, InputVar [, T]
StringUpper, OutputVar, InputVar [, T]
StringMid, OutputVar, InputVar, StartChar [, Count , L]
NewStr := SubStr(String, StartPos [, Length]) ; See the SubStr() function for details.
OutputVar := StrReplace(Haystack, SearchText [, ReplaceText, OutputVarCount, Limit := -1])  ; v1.1.21+
StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]
StringSplit, OutputArray, InputVar [, Delimiters, OmitChars]
Array := StrSplit(String [, Delimiters, OmitChars])  ; [v1.1.13+]
StringTrimLeft, OutputVar, InputVar, Count
StringTrimRight, OutputVar, InputVar, Count
NewStr := SubStr(String, StartPos [, Length]) ; See the SubStr() function for details.
StrPut(String [, Encoding = None ] )
StrPut(String, Address [, Length] [, Encoding = None ] )
StrGet(Address [, Length] [, Encoding = None ] )
NewStr := SubStr(String, StartingPos [, Length])
Suspend [, Mode]
SysGet, OutputVar, Sub-command [, Param3]
Thread, NoTimers [, false]
Thread, Priority, n
Thread, Interrupt [, Duration, LineCount]
Throw [, Expression]
ToolTip [, Text, X, Y, WhichToolTip]
Transform, OutputVar, Cmd, Value1 [, Value2]
TrayTip [, Title, Text, Seconds, Options]
Result :=  Trim(String, OmitChars = " `t")
Result := LTrim(String, OmitChars = " `t")
Result := RTrim(String, OmitChars = " `t")
UrlDownloadToFile, URL, Filename
GrantedCapacity := VarSetCapacity(UnquotedVarName [, RequestedCapacity, FillByte])
WinActivate [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinActivateBottom [, WinTitle, WinText, ExcludeTitle, ExcludeText]
IfWinActive [, WinTitle, WinText,  ExcludeTitle, ExcludeText]
IfWinNotActive [, WinTitle, WinText, ExcludeTitle, ExcludeText]
UniqueID := WinActive("WinTitle", "WinText", "ExcludeTitle", "ExcludeText")
WinClose [, WinTitle, WinText, SecondsToWait, ExcludeTitle, ExcludeText]
IfWinExist [, WinTitle, WinText,  ExcludeTitle, ExcludeText]
IfWinNotExist [, WinTitle, WinText, ExcludeTitle, ExcludeText]
UniqueID := WinExist("WinTitle", "WinText", "ExcludeTitle", "ExcludeText")
WinGet, OutputVar [, Cmd, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinGetActiveStats, Title, Width, Height, X, Y
WinGetActiveTitle, OutputVar
WinGetClass, OutputVar [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinGetPos [, X, Y, Width, Height, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinGetText, OutputVar [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinGetTitle, OutputVar [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinHide [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinKill [, WinTitle, WinText, SecondsToWait, ExcludeTitle, ExcludeText]
WinMaximize [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinMenuSelectItem, WinTitle, WinText, Menu [, SubMenu1, SubMenu2, SubMenu3, SubMenu4, SubMenu5, SubMenu6, ExcludeTitle, ExcludeText]
WinMinimize [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinMinimizeAll
WinMinimizeAllUndo
WinMove, X, Y
WinMove, WinTitle, WinText, X, Y [, Width, Height, ExcludeTitle, ExcludeText]
WinRestore [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinSet, Attribute, Value [, WinTitle, WinText,  ExcludeTitle, ExcludeText]
WinSetTitle, NewTitle
WinSetTitle, WinTitle, WinText, NewTitle [, ExcludeTitle, ExcludeText]
WinShow [, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinWait [, WinTitle, WinText, Seconds, ExcludeTitle, ExcludeText]
WinWaitActive [, WinTitle, WinText, Seconds, ExcludeTitle, ExcludeText]
WinWaitNotActive [, WinTitle, WinText, Seconds, ExcludeTitle, ExcludeText]
WinWaitClose [, WinTitle, WinText, Seconds, ExcludeTitle, ExcludeText]
#AllowSameLineComments
#ClipboardTimeout Milliseconds
#CommentFlag NewString
#ErrorStdOut
#EscapeChar NewChar
#HotkeyInterval Milliseconds
#HotkeyModifierTimeout Milliseconds
#Hotstring NoMouse
#Hotstring EndChars NewChars
#Hotstring NewOptions
#IfTimeout Timeout
#IfWinActive [, WinTitle, WinText]
#IfWinExist [, WinTitle, WinText]
#IfWinNotActive [, WinTitle, WinText]
#IfWinNotExist [, WinTitle, WinText]
#If [, Expression]
#Include FileOrDirName
#Include <LibName>
#IncludeAgain FileOrDirName
#InputLevel [, Level]
#InstallKeybdHook
#InstallMouseHook
#KeyHistory MaxEvents
#MaxHotkeysPerInterval Value
#MaxMem Megabytes
#MaxThreads Value
#MaxThreadsBuffer On|Off
#MaxThreadsPerHotkey Value
#MenuMaskKey KeyName
#NoEnv
#NoTrayIcon
#Persistent
#SingleInstance [force|ignore|off]
#UseHook [On|Off]
#Warn [, WarningType, WarningMode]
#WinActivateForce
HBITMAP:bitmap-handle
HICON:icon-handle
Enum.Next(OutputVar1 [, OutputVar2, ...])
File.Write(String)
Line := File.ReadLine()
File.WriteLine([String])
Num := File.ReadNumType()
File.WriteNumType(Num)
File.RawRead(VarOrAddress, Bytes)
File.RawWrite(VarOrAddress, Bytes)
File.Seek(Distance [, Origin = 0])
File.Position := Distance
File.Pos := Distance
Pos := File.Tell()
Pos := File.Position
Pos := File.Pos
FileSize := File.Length
File.Length := NewSize
IsAtEOF := File.AtEOF
File.Close()
Encoding := File.Encoding
File.Encoding := Encoding
File.__Handle
Func.Call(Parameters)  ; v1.1.19+
BoundFunc := Func.Bind(Parameters)
Func.Name
Func.IsBuiltIn
Func.IsVariadic
Func.MinParams
Func.MaxParams
Func.IsByRef(ParamIndex)
Func.IsOptional(ParamIndex)
Object.InsertAt(Pos, Value1 [, Value2, ... ValueN])
Object.RemoveAt(Pos [, Length])
Object.Push([ Value, Value2, ..., ValueN ])
Value := Object.Pop()
MinIndex := Object.MinIndex()
MaxIndex := Object.MaxIndex()
Length := Object.Length()
Object.SetCapacity(MaxItems)
Object.SetCapacity(Key, ByteSize)
MaxItems := Object.GetCapacity()
ByteSize := Object.GetCapacity(Key)
Ptr := Object.GetAddress(Key)
Enum := Object._NewEnum()
Object.HasKey(Key)
Clone := Object.Clone()
ObjRawSet(Object, Key, Value)
Object.Insert(Pos, Value1 [, Value2, ... ValueN ])
Object.Insert(Value)
Object.Insert(StringOrObjectKey, Value)
Object.Remove(FirstKey, LastKey)
which is the basis for this script.
Misc
As far as i'm concerned, you may use this in any way and any context you like.
Good luck :wave:
Edit: Fixed cycle bug. (Ty Relayer)
Last edited by Helgef on 09 Aug 2017, 03:39, edited 4 times in total.
User avatar
Relayer
Posts: 160
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

07 Feb 2017, 14:14

Helgef,

Small bug... example is 'loop' does not toggle through all of the defined hotkeys because some of them are typed with an alphanumeric preceding them as opposed to a space. The :O: in that case needs to be :O?: in order for the next one to trigger.

Relayer
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

07 Feb 2017, 14:24

Thank you, I think I messed up this version, I removed all ? Because some hotstrings triggered inside some others, but as you point out, they need to remain in the cycles.
Edit: Fixed, updated code.
Last edited by Helgef on 07 Feb 2017, 15:39, edited 1 time in total.
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

07 Feb 2017, 14:44

Thank you. I use Notepad2-mod because it can autocomplete any word in the file and this was the one feature from SciTE4AutoHotkey I've always wanted in Notepad2 :-)
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

08 Feb 2017, 06:35

Hi qwerty12.
I used to use SciTE, and there I had these popups to show the parameters, but sometimes they closed before I was done.
popup.png
popup.png (3.01 KiB) Viewed 28930 times
I switched (back) to np++ though, there were some problems with scite.
What I would like to extend this to, is to make it work when I autocomplete a command in np++. :think: I guess I could make hotstrings for that too.
Notepad++ also autocompletes any word in the file, an excellent feature.
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

08 Feb 2017, 11:01

Hey Helgef,

Sorry, yeah, the popups are what I meant. Notepad2-mod I install out of necessity (I always seem to end up with files with UNIX line endings, and I hate loading such files into Wordpad because of MS Notepad's inability to handle such files).

Thanks for the NP++ pointer - I've used it sporadically over the years, abandoning it for Notepad2-mod in the end (my needs from a text editor are simple :D), but Notepad2-mod isn't playing nice with my dark Windows theme so I should take another look.

Anyway, thank you again for the script! I wish I could add things to it (as silly as it sounds when it comes to a language named AutoHotkey, my actual hotkey knowledge is really poor), but it's honestly working great for me as it is. I have no need to open up the help file to see functions' parameter positions anymore!

EDIT: In reply to your reply below, :thumbup: Thanks, I'll take a look at that thread :-)
Last edited by qwerty12 on 08 Feb 2017, 12:42, edited 1 time in total.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

08 Feb 2017, 12:19

qwerty12 wrote: Thanks for the NP++ pointer
Here is another one, Setup Notepad++ for AutoHotkey ;)
qwerty12 wrote:no need to open up the help file to see functions' parameter positions anymore!
Exactly my main reason for this script, expand, delete what's not needed, and keeping those commas :thumbup:
User avatar
noname
Posts: 515
Joined: 19 Nov 2013, 09:15

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

09 Feb 2017, 07:18

This will be a major addon looking at how well the first tries went .Thanks for sharing Helgef :)
guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

09 Mar 2017, 07:06

This is awesome, I should port this to Vim but I'm too lazy. This could be great for snippet replacements

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

10 Mar 2017, 11:49

This is really great. Thanks for sharing. What is strange is that it works instantly like in your attached preview videos in most editors I tried (Notepad, Sublime Text 3, CodeQuickTester), but it's slow when used in SciTE4AutoHotkey and very slow in Notepad++ (the one I really want it for). You can see it going through all kinds of machinations before it displays the text, especially when tabbing through various options like your "loop" example. Any idea why that might be the case?

EDIT: I see what is causing it in Notepad++. Once I turned off Notepad++'s auto-completion, it works great. Do you have auto-completion turned off on yours? (I realize that your hotstrings won't work if I let auto-complete finish the command/function name, but it's nice to have to auto-complete other things)
guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

10 Mar 2017, 12:08

boiler wrote:This is really great. Thanks for sharing. What is strange is that it works instantly like in your attached preview videos in most editors I tried (Notepad, Sublime Text 3, CodeQuickTester), but it's slow when used in SciTE4AutoHotkey and very slow in Notepad++ (the one I really want it for). You can see it going through all kinds of machinations before it displays the text, especially when tabbing through various options like your "loop" example. Any idea why that might be the case?

EDIT: I see what is causing it in Notepad++. Once I turned off Notepad++'s auto-completion, it works great. Do you have auto-completion turned off on yours? (I realize that your hotstrings won't work if I let auto-complete finish the command/function name, but it's nice to have to auto-complete other things)
maybe you could try changing the endchar in Helgef's hotstrings

Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

10 Mar 2017, 13:13

I'm using it in notepad++, the previews are made there too, but I turned off autocomplete for the previews. But I have re-enabled it since, and I didn't notice any problems. I'll take a look at again when I get back to the computer.
You are right about that you cannot autocomplete with notepad++ and trigger the hotstrings. I'm working on that, in a somewhat idle pace. :yawn:
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

10 Mar 2017, 14:22

@guest3456, about the endchar, good point, tab can also trigger the auto complete, so there it a potential for trouble. Actually, #Hotstring EndChars `t shouldn't really be there at all, that's just my personal preference.
@boiler, you can also try to replace SendMode, Input, with SetKeyDelay,-1,-1.
User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

10 Mar 2017, 14:53

Thanks for the suggestions, guys.

Changing the EndChar didn't help. I think that's because auto-complete is happening well after it's triggered by the end key. It gets triggered and re-triggered simply by the text that's output by the hotstring script. As the hotstring's output is being typed out, the auto-complete keeps trying to open dropdown lists (you can see windows flashing and disappearing as the hotstring result gets partially typed out).

Changing the SendMode line to SetKeyDelay seems to also have helped some. I still see all the dropdown windows flash, but it happens faster. So maybe I'll go with it like this. The difference is mainly just aesthetics (and a little slower), so I maybe it's worth it to leave auto-complete on.

In any event, this hotstring script is super helpful, and because of it, I'm probably going to be using Notepad++ as my regular AHK editor.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

08 Apr 2017, 11:09

It seems like :OB0:StrSplit::(String [, Delimiters, OmitChars]) is missing, just add it to (eg) the end of the script, if desired.
I might update the script later, when I feel less lazy. :|
Edit:
Another missing:

Code: Select all

:OB0:StrReplace::(Haystack, SearchText [, ReplaceText, OutputVarCount, Limit := -1])
Asmodeus
Posts: 57
Joined: 19 Oct 2015, 15:53

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

04 Aug 2017, 17:07

Helgef wrote:parameters can be cycled with tab, eg,
unfortunatelly it's not working in AutoGUI, pressing tab deletes parameters.

Image
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

04 Aug 2017, 18:03

Hello.
It seems AutoGUI doesn't cooperate well with any hotstrings. You can ask for help in the AutoGUI thread regarding that. I'd recommend you try this nice script by boiler: Insert AHK Command/Function Parameters (with Search/Auto-Complete).
boiler wrote: It currently works with Notepad++, SciTE4AutoHotkey, AHK Studio, and AutoGUI. It should work with any editor that accepts pasted text and returns caret positions by adding the editor's WinTitle to the ahk_group.
My emph

Cheers.

Edit: I just tried and boiler's scrip seems to work very well in autogui :thumbup:
Asmodeus
Posts: 57
Joined: 19 Oct 2015, 15:53

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

04 Aug 2017, 18:23

thanks.

i tried out the other script but unfortunately I find it not very intuitive, at least in my work-flow I'd rather prefer this one.
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: [Hotstrings] Expand parameters for AHK's functions, commands and directives.

06 Aug 2017, 16:56

Expansion of parameters in AutoGUI is done with Ctrl+Insert or by clicking the calltip.

Return to “Editors”

Who is online

Users browsing this forum: No registered users and 23 guests