Page 1 of 1

Autoit move dialogs script

Posted: 30 Oct 2013, 11:14
by CartoonMonkey
Hello all. I've been using this Autoit Script for PC, that shunts dialog boxes over to my Cintiq from my 2nd monitor.
( Having TVPaint stretched over two monitors )

Maybe it can help someone out there. \
I have the interface / requester system 1 dialogs in preferences set to a bright lime green that I would never use in an animation project..
Autoit does a pixelsearch for this color, in a certain x y set of coordinates for each misbehaving dialog box, and then moves the dialog box to another
set of x y coordinates, grabbing it with the mouse and moving it on over.

You'll have to use a tool like the crosshair in PicPick to grab the screen coordinates you want autoit to detect for your setup, in each instance..as your
screen resolutions / window placement might vary.

Here it is..
Saves me quite a bit of time looking for dialog boxes, allowing me to concentrate on my work a bit more.
C


----------
$hWnd = WinGetHandle("[CLASS:TVP Animation 10 Pro beta]") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Set the window class here (get it from Au3Info)
If @error Then
MsgBox(16, "", "Window not found, this script will now exit.")
Exit
EndIf
While 1
If WinGetHandle("[active]") = $hWnd Then ;If the active window is the same as the $hWnd variable then we check pixels.
#region Animbrush dialog
$aiPixelSearch = PixelSearch(1212, 726,1218, 734,"0xA5F700")
If IsArray($aiPixelSearch) Then
MouseMove(1235, 678, 0) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Mouse moves' 3rd parameter changes speed.
MouseClickDrag("left", 1235, 678, 3300, 410, 0)
EndIf
#endregion Animbrush dialog

#region Close dialog
$aiPixelSearch = PixelSearch(1191, 734, 1200, 741, "0xA5F700")
If IsArray($aiPixelSearch) Then
MouseMove(1240, 669, 0)
MouseClickDrag("left", 1240, 669, 3300, 410, 0)
EndIf
#endregion Close dialog

#region FX Stack Progress Profile Dialog
$aiPixelSearch = PixelSearch(215, 274, 222, 282, "0xA5F700")
If IsArray($aiPixelSearch) Then
MouseMove(286, 220, 0)
MouseClickDrag("left", 286, 220, 3300, 410, 0)
EndIf
#endregion FX Stack Progress Profile Dialog

#region Layer adjust
$aiPixelSearch = PixelSearch(217, 790, 1222, 795, "0xA5F700")
If IsArray($aiPixelSearch) Then
MouseMove(1248, 621, 0)
MouseClickDrag("left", 1248, 621, 3300, 410, 0)
EndIf
#endregion Layer adjust

#region Close / Save
$aiPixelSearch = PixelSearch(1078, 626, 1084, 733, "0xA5F700")
If IsArray($aiPixelSearch) Then
MouseMove(1154, 677, 0)
MouseClickDrag("left", 1154, 677, 3300, 410, 0)
EndIf
#endregion Close / Save

#region Decrease Layer Length
$aiPixelSearch = PixelSearch(1215, 751, 1225, 755, "0xA5F700")
If IsArray($aiPixelSearch) Then
MouseMove(1251, 656, 0)
MouseClickDrag("left", 1251, 656, 3300, 410, 0)
EndIf
#endregion Decrease Layer Length

#region Merge Layers
$aiPixelSearch = PixelSearch(1218, 745, 1225, 761, "0xA5F700")
If IsArray($aiPixelSearch) Then
MouseMove(1230, 661, 0)
MouseClickDrag("left", 1230, 661, 3300, 410, 0)
EndIf
#endregion Merge Layers
EndIf
Sleep(10) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Sleep to avoid high CPU usage
WEnd