Send test to ComboBox32Ex in open dialog

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Peter
Newbie
Posts: 1
Joined: Thu Jul 31, 2008 4:28 pm

Send test to ComboBox32Ex in open dialog

Post by Peter » Thu Jul 31, 2008 4:43 pm

This command
PushButton>Source Documents And Imposition Index,Add
opens the dialog correctly and the focus is by default on the combobox into which i would like to enter a filename.

I started by using Send>sometext but the text does not appear.
I have added press tabs to see if the characters will be sent. But they dont seem to change the focus.
The flashing cursor just stays in the combobox.

One note is that the prior window is also a dialog box.
Would this matter.

If after the macro has finished i press a text key it does get entered into the combobox.

Could you suggest anything?
Should Send> enter text into a combobox?

Thanks
Peter

Code: Select all

Let>SK_DELAY=1
VBSTART
VBEND

Let>file01=""
VBEval>DatePart("yyyy",Now()) & "_" & Right("0" & DatePart("m", Now()),2) & "_" & Right("0" & DatePart("d", Now()),2) & "_" & Right("0" & DatePart("h", Now()),2) & Right("0" & DatePart("n", Now()),2) & Right("0" & DatePart("s", Now()),2) ,file01


Let>filename=T:\Studio\Drop Drives\Imposition_Bcards\Any_size\Automation.DLY
SetFocus>DynaStrip*
Wait>1
Press ALT
Send>FO
Release ALT
Send Character/Text>filename
Press ALT
Send>O
Release ALT
Send Character/Text>file01
Press Enter
Wait>1
Press ALT
Send>i
Release ALT
Wait>1
GetListItem>Save: DynaStrip Job ,SysListView32,0,Imposition Junk,0,0,0,result
Press Enter
Wait>1
Press ALT
Send>FD
Release ALT
Wait>1
PushButton>Source Documents And Imposition Index,Add
Wait>10
setFocus>Open*
Let>SK_DELAY=1
Press Tab
Press Tab
Press Tab


User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Aug 03, 2008 7:19 am

I notice a glaring lack of WaitWindowOpen in your code. Quite possibly what is happening is your script is not allowing time for the dialog to appear before it tries to send the text to it. First step is to use WaitWindowOpen. So after ALT-fo which invokes the file open box you need a WaitWindowOpen to wait for that dialog. THEN you can send the filename.

At present your script sends filename immediately (by immediately I'm talking microseconds) after sending ALT-fo. But it takes more than microseconds for the dialog to appear.

Have a look at the Beginners Guide to Scripting Windows in the help file which explains these concepts. Also read:
http://www.mjtnet.com/blog/2006/01/17/h ... on-script/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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