This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Obj2Str(obj) { | |
str := "" , array := true | |
for k in obj { | |
if (k == A_Index) | |
continue | |
array := false | |
break | |
} | |
for a, b in obj | |
str .= (array ? "" : "'" a "': ") . (IsObject(b) ? Obj2Str(b) : "'" b "'") . ", " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RemoveDuplicate(str, delim:="`n", cs:=false) { | |
_ := cs ? ComObjCreate("Scripting.Dictionary") : [] | |
Loop, Parse, str, % delim | |
alf := A_LoopField | |
, out .= cs ? (_.Exists(alf) ? "" : (alf . delim, _.Add(alf, 1))) | |
: (_[alf] ? "" : (alf . delim, _[alf] := 1)) | |
return RTrim(out, delim) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; http://www.autohotkey.com/board/topic/20925-listvars/#entry156570 | |
VAR_get() { | |
global | |
static hEdit, pSFW, pSW, bkpSFW, bkpSW | |
local dhw, AStr, Ptr, hmod, text, v, i := 0, vars := [] | |
if !hEdit { | |
dhw := A_DetectHiddenWindows | |
DetectHiddenWindows, On | |
ControlGet, hEdit, Hwnd,, Edit1, % "ahk_id " A_ScriptHwnd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DynaRun(script, name:="", args*) { ;// http://goo.gl/ECC6Qw | |
if (name == "") | |
name := "AHK_" . A_TickCount | |
;// Create named pipe(s), first one is a dummy | |
for each, pipe in ["__PIPE_GA_", "__PIPE_"] | |
%pipe% := DllCall( | |
(Join Q C | |
"CreateNamedPipe", ;// http://goo.gl/3aJQg7 | |
"Str", "\\.\pipe\" . name, ;// lpName | |
"UInt", 2, ;// dwOpenMode = PIPE_ACCESS_OUTBOUND |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Derived from Wicked - can't locate his thread but found this in the ff thread: | |
http://www.autohotkey.com/board/topic/97642-urldownloadtofile/#entry614852 | |
*/ | |
Download(url, dest) { | |
static r | |
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1") | |
if (!r || whr.Option(1) != url) |
OlderNewer