Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.3: Using AppleScript UI scripting on AXUnknown elements' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Using AppleScript UI scripting on AXUnknown elements
Authored by: dahjelle on Dec 03, '03 12:27:06PM

Perhaps a bit off topic, but has anyone managed to UI script the print dialogs or sheets in Panther? I spent a good chunk of last weekend trying to get it to work, but didn't have any success.

Perhaps it was due to my inexperience with AppleScript.

Thanks for any hints you might have!



[ Reply to This | # ]
10.3: Using AppleScript UI scripting on AXUnknown elements
Authored by: mdc1952 on Dec 03, '03 01:00:22PM

I've tried it once so far; it would sure help if there were more documentation about GUI scripting. I did get a test script to work to save as a postscript file, but it took awhile to figure out how to get the dialog configured. I used both Apple's and Prefab's Element Inspector until I found some example somewhere that finally cracked how to get to the output options. I think it was bascially the problem outlined in this hint. The relevant portion of the code was:
click menu item "Print…" of menu "File" of menu bar 1
click pop up button 1 of window "Print"
click menu item 3 of menu 1 of pop up button 1 of window "Print"
delay 1
click checkbox "Save as File" of UI element 1 of UI element 3 of window "Print"
click pop up button 1 of UI element 1 of UI element 3 of window "Print"

click menu item 2 of menu 1 of pop up button 1 of UI element 1 of UI element 3 of window "Print"
delay 1
click button "Save…" of UI element 4 of window "Print"


I then had to use the keystroke command to spell out the file name I wanted as I couldn't find away to just set it from a variable (i'm not sure if I tried just pasting it".



[ Reply to This | # ]