Trouble with code in script

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Robin

Trouble with code in script

Post by Robin » Thu Jan 27, 2005 5:46 pm

This is my first script:

SetFocus>Pegasus*
Press CTRL
send>c
Release CTRL
Run Program>D:\Program Files\OpenOffice.org1.1.2\program\soffice.exe
WaitWindowOpen>Untitled1 - OpenOffice.org 1.1.3
Press CTRL
send>V
Release CTRL


Here are my problems:

I have tested the above with Debug. Where can I view the results of running under debug?


The script hangs at waitwindowopen. What should I change?

Having exited from the Editor, I am finding that I am locked into the Macro Screen (it is a plain macro screen with no named macro in it ). I am unable to get out. It says at the top of the screen "Macro Scheduler Eval script running" What should I do to exit?

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Re: Trouble with code in script

Post by Captive » Fri Jan 28, 2005 12:57 am

Robin wrote:The script hangs at waitwindowopen. What should I change?
You're launching from directory 1.1.2 but the window says 1.1.3?

There is probably something not matching the window title with the one you're having it wait for. You can obtain the "exact" title bar using another script, something like:

MessageModal>After you click OK, set focus to a window. I will obtain it's handle in 5 seconds.
Wait>5
Let>WF_TYPE=2
Let>WIN_USEHANDLE=0
GetActiveWindow>sWinTitle,iWinLeft,iWinTop,iWinWidth,iWinHeight
Let>sLine1=Window Title: %sWinTitle%
Let>sLine2=Left/Top=%iWinTop%,%iWinLeft%
Let>sLine3=Width/Height=%iWinWidth%,%iWinHeight%
MessageModal>%sLine1%%CRLF%%sLine2%%CRLF%%sLine3%

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts