楼主:
topwing (Levin)
2014-04-28 14:33:01※ 引述《solomn (九米)》之铭言:
: #Z::
: Send, ^c
: Sleep 500
: Run, http://www.google.com.tw/search?q=%clipboard%
: Return
: 像上面这个小程式码
: 如何增加功能
: 可以在反白的如果是网址时
: 则是进入网址
: 原程式码会把网址也当作文字
: 丢到Google做搜寻文字
: 谢谢
此范例以Firefox作为浏览器并且要开启著
因为我的习惯是浏览网页时FF一定都开启著
所以做这些查询动作时FF必定也是开启的状态
当然如果你要写个在最初的状态下也就是浏览器未开启前执行到最后的开启网页也是可以
#Z::
StringLeft, DecideVar, Clipboard, 7 ;撷取 Clipboard 中从左到右7个字符至
变量 DecideVar
if DecideVar = http://
{
SetTitleMatchMode 2
WinTitle = Mozilla Firefox ;将变量 WinTitle 设为“Mozilla Firefox”
IfWinExist %WinTitle% ;这边确认有开启 Firefox
{
WinActivate ;如果 Firefox 有开启,移至最前
Send ^t^v{Enter} ;^t:开一个分页 ^v:将网址贴上
}
else
Msgbox, 请先开启Firefox浏览器
}
}
Return