noname wrote:Code: Select all
!a::
Send, ^c
Sleep 200
enc_Clipboard:=UriEncode(clipboard)
Run, chrome.exe https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias`%3Daps&field-keywords=%enc_Clipboard%
return
UriEncode(Uri) {
VarSetCapacity(Var, StrPut(Uri, "UTF-8"), 0)
StrPut(Uri, &Var, "UTF-8")
f := A_FormatInteger
SetFormat, IntegerFast, H
while Code := NumGet(Var, A_Index - 1, "UChar")
if (Code >= 0x30 && Code <= 0x39 ; 0-9
|| Code >= 0x41 && Code <= 0x5A ; A-Z
|| Code >= 0x61 && Code <= 0x7A) ; a-z
Res .= Chr(Code)
else
Res .= "%" . SubStr(Code + 0x100, -1)
SetFormat, IntegerFast, %f%
return, Res
}
wow thats alot of code, it works perfectly thanks so much. Can you tell some more how you got this code, did you write it or got it from somewhere else? I would NEVER be able to pull off that kind of code lol
I tried to merge it into wiki too this doesn't seem to match,
I just did this after I tested your code working on amazon:
Code: Select all
!a::
Send, ^c
Sleep 200
enc_Clipboard:=UriEncode(clipboard)
Run, chrome.exe https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias`%3Daps&field-keywords=%enc_Clipboard%
return
!w::
Send, ^c
Sleep 200
enc_Clipboard:=UriEncode(clipboard)
Run, chrome.exe https://en.wikipedia.org/wiki/%enc_ClipBoard%
return
UriEncode(Uri) {
VarSetCapacity(Var, StrPut(Uri, "UTF-8"), 0)
StrPut(Uri, &Var, "UTF-8")
f := A_FormatInteger
SetFormat, IntegerFast, H
while Code := NumGet(Var, A_Index - 1, "UChar")
if (Code >= 0x30 && Code <= 0x39 ; 0-9
|| Code >= 0x41 && Code <= 0x5A ; A-Z
|| Code >= 0x61 && Code <= 0x7A) ; a-z
Res .= Chr(Code)
else
Res .= "%" . SubStr(Code + 0x100, -1)
SetFormat, IntegerFast, %f%
return, Res
}
can you tell how to make this work on any other site?