alias RegRead {
if ($1 != $null) {
var %a = regread
.comopen %a WScript.Shell
if !$comerr {
var %b = $com(%a,RegRead,3,bstr,$1-)
var %c = $com(%a).result
.comclose %a
if (%c != $null) return %c
else {
return error! when reading or key does not exist
}
}
}
else { return error! complete data }
}
alias replacew {
var %a = $1, %g = $iif(3 // $calc($0 - 1),3,2), %i = 2, %re, %v1
while ($eval($+($,%i),2) != $null) {
%v1 = $v1
%n = $eval($ $+ $calc(%i + 2),2)
if (3 // $calc($0 - 1)) %re = /((?:\Q $+ $replacex(%v1,&,\E\S+\Q,*,\E\S*?\Q,?,\E\S\Q,\E,\E\\E\Q) $+ \E ){ $+ $calc($eval($ $+ $calc(%i + 2),2) - 1) $+ })\Q $+ $replacex(%v1,&,\E\S+\Q,*,\E\S*?\Q,?,\E\S\Q,\E,\E\\E\Q) $+ \E/i
else %re = $+(/\Q,$replacex(%v1,&,\E\S+\Q,*,\E.*\Q,?,\E.\Q,\E,\E\\E\Q),\E/gi)
.echo -q $regsub(%a,%re,\1 $+ $replace($eval($+($,$calc(%i + 1)),2),\,\\,$,\$),%a)
inc %i %g
}
return %a
}
on *:hotlink:*//*.*:*: http $1
on *:hotlink:*www.*:*: http $1
alias http {
var %ProgID = $RegRead(HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice\ProgID)
var %Browser = $RegRead( HKCR\ $+ %ProgID $+ \shell\open\command\ )
var %Launch = $replacew(%Browser, .exe*, .exe" " $+ $1")
run %Launch
}