Actually, the mouse returning to it's default location doesn't bother me too much. My other goal that I have now is having different plugin windows that I want up, click on render button, and then close the window. The original script is for one specific plugin I use.
Code: Select all
#Include FindText.ahk
+d::
WinMenuSelectItem, Pro Tools, , Audiosuite, Noise Reduction, RX 7 De-click
Sleep, 1000
SetMouseDelay, 20
t1:=A_TickCount, X:=Y:=""
Text:="|<>*190$41.zzzzzzz1UakM8CtTBirrBqy/QjisABKt31qvuBmyrgrqPhxbQUiks/bzzzzzzw"
if (ok:=FindText(1392, 652, 1458, 672, 0, 0, Text))
{
CoordMode, Mouse
X:=ok.1.x, Y:=ok.1.y, Comment:=ok.1.id
Click, %X%, %Y%
}
for i,v in ok
if (i<=2)
FindText_MouseTip(ok[i].x, ok[i].y)
Sleep, 50
if WinExist("ahk_class DigiFloaterClass")
WinKill
Return
As you can see, I created a hotkey (shift + d) to bring up the plugin, which works exactly the way I want it to. The problem now is when I add in another hotkey to bring up a different plugin. The plugin comes up, but the script can't find the text and the mouse does not follow and click on the render button (which the render button is identical to all other audiosuite plugins). The new plugin window just opens, then closes, but skips out all the middle function. The modified script is below.
Code: Select all
#Include FindText.ahk
+d::
WinMenuSelectItem, Pro Tools, , Audiosuite, Noise Reduction, RX 7 De-click
Sleep, 1000
SetMouseDelay, 20
t1:=A_TickCount, X:=Y:=""
Text:="|<>*190$41.zzzzzzz1UakM8CtTBirrBqy/QjisABKt31qvuBmyrgrqPhxbQUiks/bzzzzzzw"
if (ok:=FindText(1392, 652, 1458, 672, 0, 0, Text))
{
CoordMode, Mouse
X:=ok.1.x, Y:=ok.1.y, Comment:=ok.1.id
Click, %X%, %Y%
}
for i,v in ok
if (i<=2)
FindText_MouseTip(ok[i].x, ok[i].y)
Sleep, 50
if WinExist("ahk_class DigiFloaterClass")
WinKill
Return
+p::
WinMenuSelectItem, Pro Tools, , Audiosuite, Noise Reduction, RX 7 De-plosive
Sleep, 1000
SetMouseDelay, 20
t1:=A_TickCount, X:=Y:=""
Text:="|<>*190$41.zzzzzzz1UakM8CtTBirrBqy/QjisABKt31qvuBmyrgrqPhxbQUiks/bzzzzzzw"
if (ok:=FindText(1392, 652, 1458, 672, 0, 0, Text))
{
CoordMode, Mouse
X:=ok.1.x, Y:=ok.1.y, Comment:=ok.1.id
Click, %X%, %Y%
}
for i,v in ok
if (i<=2)
FindText_MouseTip(ok[i].x, ok[i].y)
Sleep, 50
if WinExist("ahk_class DigiFloaterClass")
WinKill
Return
Any ideas? Also, a bizarre behavior will happen randomly. The FindText will sometimes not find the text that's already been captured, so I'll have to re-capture it again and re-do the steps over. Maybe I'm modifying the script and something funky is happening.