本脚本来自于Thinkai的博客,仅作为归档。
UrlUpLevel(url) {
url := Trim(url, " `t`r`n/\")
url := !(url ~= "\w/\w") ? RegExReplace(url, "\w+\.(?=.*\.)",,, 1) : RegExReplace(url, "\w\K/[^/]+$")
url := (url ~= "i)^(ftp|https?)://") ? url : "http://" url
Return url
}
^!z::
clip = %clipboard% ;把网址复制到剪贴板
changdu := StrLen(clip)
StringGetPos, Var, clip, / ,R,
Var := changdu-Var
;MsgBox, %Var% %changdu%
StringTrimRight, Output1, clip, %Var%
Clipboard = %Output1%
send ^v ;粘贴到地址栏
;简单粗暴。:-)