Surgery Posted October 21, 2007 Share Posted October 21, 2007 Hey all, Ok, everything in my script seems to work fine except for when I close the program it runs (tonic.exe). Here's my code: Run('in\Tonic.exe') WinWaitActive('Macromedia Flash Player 8') $size = WinGetPos('Macromedia Flash Player 8') WinSetTitle('Macromedia Flash Player 8', '', 'Tonic V0.9') while WinExists('Tonic V0.9') $nSize = WinGetPos('Tonic V0.9') if $size[2] <> $nSize[2] Or $size[3] <> $nSize[3] then WinMove('Tonic V0.9', '', $size[0], $size[1], $size[2], $size[3]) endif WEnd all it's supposed to do is resize the window to it's original size if the user tries to resize it. It works fine, but when I close Tonic.exe I get an error that says "subscript used with non-array variable". I can't seem to find anywhere in my code where I do this. Also, it only seems to happen after I open and close Tonic.exe about four or five times, but then it happens every time again for quite a while. Is there something I should have in there about stopping the script when the window closes? Thanks. --Surgery Link to comment Share on other sites More sharing options...
Valuater Posted October 21, 2007 Share Posted October 21, 2007 Maybe... Run('in\Tonic.exe') WinWaitActive('Macromedia Flash Player 8') $size = WinGetPos('Macromedia Flash Player 8') WinSetTitle('Macromedia Flash Player 8', '', 'Tonic V0.9') While WinExists('Tonic V0.9') $nSize = WinGetPos('Tonic V0.9') If IsArray($nSize) And IsArray($size) Then If $size[2] <> $nSize[2] Or $size[3] <> $nSize[3] Then WinMove('Tonic V0.9', '', $size[0], $size[1], $size[2], $size[3]) EndIf Else MsgBox(0x0, "Test", "Size is the same", 2) ; this is just for testing EndIf WEnd 8) Link to comment Share on other sites More sharing options...
Surgery Posted October 22, 2007 Author Share Posted October 22, 2007 seems to work great! thanks, Valuater! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now