Placing text into a save as file name box in a window

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Guest

Placing text into a save as file name box in a window

Post by Guest » Sun Jan 30, 2005 11:41 pm

I am using OpenOffice and trying to save the standard name of a file into the save as dialog. In this case it is called Export, nothing else and it is a pop up wndow. The following does not work. What would?

Robin

Press ALT
send>fd
press enter
remark> the above opens the export as a pdf window.
Let>SomeText=Hello World
Send Character/Text>SomeText
Remark>Hello world does not get written into the file name box of the window.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jan 31, 2005 3:12 am

Haven't tried your scrip yet, but does Releasing ALT help at all?

Press ALT
send>fd

Release ALT

press enter
...
...
---------------------
You are probably getting a Save As window opening up also. Need to
set focus before typing in box:

WaitWindowOpen>Name*
SetFocus>Name*
WaitReady>1
Now you cand Send>Words.....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Robin

Post by Robin » Mon Jan 31, 2005 6:20 pm

I regret the following part of my script is still not working even with the changes you suggested. I think it is something to do with the program not staying focused on the "Export" screen.

Robin

Remark>output as a pdf
Press ALT
send>fd
press enter
release ALT
WaitWindowOpen>export*
SetFocus>export*
WaitReady>1
Press ALT
send>n
Release ALT
Let>SomeText=Hello World
Send>SomeTextHello World

Guest

Post by Guest » Mon Jan 31, 2005 6:24 pm

Let>SomeText=Hello World
Send>SomeTextHello World
I have noticed that the send is not the same as the variable. This is because MSch is posting the quote to my macro code rather than the required text box in the window and I have saved it. This comes from my running the debug. The debug does not retain the focus so it is posting the send to the wrong place. This supports my suggestion that the focus is not being maintained.

Robin

robin

Post by robin » Mon Jan 31, 2005 6:33 pm

WaitWindowOpen>export*
SetFocus>export*
WaitReady>1
Press ALT
send>n
Release ALT
SetFocus>export*

Let>SomeText=Hello World
Send>SomeText

By putting in the extra setfocus as above I have managed to get the program to put the text into the text box. Can you see why the macro loosing its focus so that I have to refocus it? Is there a fault in my script?

Robin

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jan 31, 2005 10:54 pm

Only need one SetFocus> in my OpenOffice.org, version 1.1.1
--------------------------------------------------
Try adding a Wait>n after WaitReady>1 (you can play with Wait> value):
WaitReady>1
Wait>2

And/Or

Try setting the keyboard delay to a higher value (you can play with values):
Let>SK_DELAY =2

Try adding a Wait>2 after WaitReady>1
-------------------------
Also, can run at normal speed, and look at a log to see what happened.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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