Brand New - question on dialog result

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
RGatling
Newbie
Posts: 2
Joined: Mon Jan 01, 2007 9:47 pm

Brand New - question on dialog result

Post by RGatling » Mon Jan 01, 2007 9:54 pm

forgive my total ignorance - I'm starting from no knowledge whatsoever.
I'm attempting to open a pdf fax coversheet, enter a date (I've accomplished this much), then have a box that opens asking how many pages and enter the number in the appropriate location on the form.
Advice please?
thanks.

Here's what I have:
Run Program>G:\program Files\Adobe\Adobe Acrobat 6.0\Acrobat\Acrobat.exe
ExecuteFile>G:\documents and Settings\adVAntage VA\Desktop\adVAntage\Stonaker and Coale\Joe's work\Plainsboro twp\Plainsboro Billing Fax.pdf
WaitWindowOpen>Adobe Acrobat Professional - [Plainsboro Billing Fax.pdf]
MouseMove>717,628
LClick
Month>mm
Day>dd
Year>yyyy
Let>msg=%mm%/%dd%/%yyyy%
Send>msg
Press Enter
Wait>3
MouseMove>727,572
LClick
Dialog>Dialog1
Caption=Number of pages
Width=300
Height=180
Top=200
Left=400
Label>Enter Number of pages:,5,5
Edit=MyEdit,5,22,230,EditText
Button=OK,200,100,41,25,1
EndDialog>Dialog1

Let>EditText=number of pages
Show>Dialog1,result
Send>%result%

Label>End

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Mon Jan 01, 2007 11:03 pm

Here are some corrections for the code beginning at your dialog.

Dialog>Dialog1
Caption=Number of pages
Width=300
Height=180
Top=200
Left=400
Label=Enter Number of pages:,5,5
Edit=MyEdit,5,22,230,EditText
Button=OK,200,100,41,25,1
EndDialog>Dialog1

Let>EditText=number of pages
Show>Dialog1,result
wait>.05
Send>%Dialog1.MyEdit%

Note: You cannot include a Label> (as used in program control) within a dialog, you can only use a Label= (as in naming a text control on the screen) within a dialog. simple fix there.

Next you were sending the %result% of the dialog instead of the value stored in your MyEdit edit control. Dialogs use a result to determine which button was pushed on a dialog, not the values of edits, checkboxes, comboboxes, etc...

This code should work you if you paste it in where your dialog starts. Normal coding convention also is that you might move your Dialog definition to the first lines of your program. It is not important that you define a dialog just before using it, just that you have it defined ANYTIME before you use it.

I would warn you also about using simple MouseMove> commands, they are not the most reliable method for pressing a button or locating the mouse within an edit.

clear enough? if not, ask again....

RGatling
Newbie
Posts: 2
Joined: Mon Jan 01, 2007 9:47 pm

Post by RGatling » Mon Jan 01, 2007 11:36 pm

Cool! Thanks so much, it works perfectly.

Regarding the mouse moves - I tried to use Press Tab, but Acrobat wouldn't respond to the command.

thank you for the explanations as well. I have no idea what normal coding is. I've just spent the last four hours using what I've found on the Forums to get this far. Four hours for five seconds of program. Scary learning curve.

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Tue Jan 02, 2007 1:51 am

If you stay at it, the learning curve will level out quickly.

and there are many talented programmers here who are willing to help. Also remember to search the forums before you start something new...always somebody that's already written what you're trying to do....(usually)..

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