那一段是为了在保存时重新加载脚本, 是活动窗口的名字, 删掉这一段也不影响
哦,改成1/4需要怎么改呀
RightHalf := A_ScreenWidth /2
TopHalf := A_ScreenHeight /2
删掉, 换下面的
(MouseX > A_ScreenWidth*0.75 && MouseX < A_ScreenWidth-10 && MouseY = 0) { ; 上右
(MouseX > A_ScreenWidth-2 && MouseY > 10 && MouseY < A_ScreenHeight/4) { ; 右上
运行不了呀,出错了
#NoEnv
#Warn
#SingleInstance
#Persistent
CoordMode, Pixel, Screen
SetTimer, OnMouseMove, 200
topRight := false, rightTop := false, rightTopCorner := false, popUp := false
OnMouseMove:
CoordMode, Mouse, screen
MouseGetPos, MouseX, MouseY
;if WinActive("ahk_exe chrome.exe"){
if (MouseX > A_ScreenWidth*0.75 && MouseX < A_ScreenWidth-30 && MouseY = 0) { ; 上右
MouseMove, MouseX, MouseY+50
topRight := true, rightTop := false, rightTopCorner := false
} else if (MouseX > A_ScreenWidth-2 && MouseY > 30 && MouseY < A_ScreenHeight/4) { ; 右上
MouseMove, MouseX-50, MouseY
rightTop := true, topRight := false, rightTopCorner := false
} else if (MouseX > A_ScreenWidth -30 && MouseY < 30) { ; 右上角
MouseMove, MouseX-50, MouseY+50
rightTopCorner := true, topRight := false, rightTop := false
}
if(topRight = true){
Send !h ;------------------------------------------------alt+h
Sleep 1000
WinGetPos, x, y, w, h, A
id_ := WinExist("A")
WinWaitActive, ahk_id %id_%
if ErrorLevel
{
topRight := true
}
else
topRight := false, popUp := true
}
if(rightTop = true){
Send !l ;------------------------------------------------alt+l
Sleep 1000
WinGetPos, x, y, w, h, A
id_ := WinExist("A")
WinWaitActive, ahk_id %id_%
if ErrorLevel
{
rightTop := true
}
else
rightTop := false, popUp := true
}
if(rightTopCorner = true){
Send !g ;------------------------------------------------alt+g
Sleep 1000
WinGetPos, x, y, w, h, A
id_ := WinExist("A")
WinWaitActive, ahk_id %id_%
if ErrorLevel
{
rightTopCorner := true
}
else
rightTopCorner := false, popUp := true
}
if((popUp = true && MouseX < x ) or (popUp = true && MouseY > y + h)){
send {Esc}
popUp := false
}
return
;}
ok,话说帖子的消息提醒只能站内吗,如何桌面提醒呀,地址栏的通知打开能实现吗
大佬求个脚本,任务栏左半边滚轮切换任务栏不同打开的应用,右半边滚轮切换浏览器标签页,如果浏览器未打开,则全部是切换应用,谢了
搞不定 鼠标滚轮只能在两个窗口间切换, 相当于按下Alt和tab 然后立即释放了, 要在多个窗口切换,需要按住Alt不动再按tab, 已经折腾好几个小时了, 快吐了
哦,那求另一个,在chrome浏览器内,所有点击链接的操作,点击鼠标中键时发送shift+鼠标中键
大佬这种能实现吗
谢谢了,之前的脚本测试发现右上角区域太小,容易误触,可以把右上角单独改为横竖区域都是两个关闭长度吗,其他两个不变
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
自己动手丰衣足食
1.安装脚本:
2.打开网页:
3. 然后你可以在网页提问
比如:
a. “给下面脚本加上详细的注释…”
b. “把右上角单独改为横竖区域都是两个关闭长度”
c. “把右上角触发区域扩大一点”
#SingleInstance
#Persistent
CoordMode, Pixel, Screen
SetTimer, OnMouseMove, 200
topRight := false, rightTop := false, rightTopCorner := false, popUp := false
OnMouseMove:
CoordMode, Mouse, screen
MouseGetPos, MouseX, MouseY
if WinActive("ahk_exe chrome.exe"){
broswerId := WinExist("ahk_exe chrome.exe")
if (MouseX > A_ScreenWidth*0.75 && MouseX < A_ScreenWidth-90 && MouseY = 0) { ; 上右
MouseMove, MouseX, MouseY+50
topRight := true, rightTop := false, rightTopCorner := false
} else if (MouseX > A_ScreenWidth-2 && MouseY > 30 && MouseY < A_ScreenHeight/4) { ; 右上
MouseMove, MouseX-50, MouseY
rightTop := true, topRight := false, rightTopCorner := false
} else if (MouseX > A_ScreenWidth -90 && MouseY < 90) { ; 右上角
MouseMove, MouseX-50, MouseY+50
rightTopCorner := true, topRight := false, rightTop := false
}
if(topRight = true){
Send !h ;------------------------------------------------alt+h
Sleep 1000
WinGetPos, x, y, w, h, A
;~ id_ := WinExist("A")
;~ if(id_ != broswerId){
;~ WinWaitActive, ahk_id %id_%
;~ if ErrorLevel
;~ {
;topRight := true ,id_ :=""
;~ }
;~ else
topRight := false, popUp := true
;~ MouseMove, x+w/2, y+h/2
;~ }else{
;~ topRight := true ,id_ :=""
;~ }
}
if(rightTop = true){
Send !l ;------------------------------------------------alt+l
Sleep 1000
WinGetPos, x, y, w, h, A
;~ id_ := WinExist("A")
;~ if(id_ != broswerId){
;~ WinWaitActive, ahk_id %id_%
;~ if ErrorLevel
;~ {
; rightTop := true
;~ }
;~ else
rightTop := false, popUp := true
;~ MouseMove, x+w/2, y+h/2
;~ }else{
;~ rightTop := false
;~ }
}
if(rightTopCorner = true){
;~ if(popUp = false){
Send !g ;------------------------------------------------alt+g
Sleep 1000
WinGetPos, x, y, w, h, A
;~ id_ := WinExist("A")
;~ if(id_ != broswerId){
;~ tooltip 不等于
;~ sleep 1000
;~ ToolTip
;~ WinWaitActive, ahk_id %id_%
;~ if ErrorLevel
;~ {
;~ rightTopCorner := true
;~ }
;~ else
rightTopCorner := false, popUp := true
;~ MouseMove, x+w/2, y+h/2
;~ }
;~ else{
;~ tooltip 100
;~ sleep 1000
;~ ToolTip
;~ rightTopCorner := true
;~ }
;}
;~ else if(popUp = true){
;~ tooltip 107
;~ sleep 1000
;~ ToolTip
;~ send {Esc}
;~ popUp := false, rightTopCorner := false
;~ }
}
if((popUp = true && MouseX < x ) or (popUp = true && MouseY > y + h)){
send {Esc}
popUp := false
}
return
}
请问出现下面的错误应该怎么修改
Error: Call to nonexistent function.
Specifically: AltUp()
Line#
001: Return
001: AltClick()
001: Return.
003: AltUp()
003: Return
005: {
006: SendInput,{Alt Down
007: SetTimer.ClickRight.300
008: KeyWait,XButton2
009: SetTimer,ClickRight,Off
010: SendInput,{Alt Up}
The program will exit.