Stuck with GUI scripting
Stuck with GUI scripting
- Subject: Stuck with GUI scripting
- From: Brett Conlon <email@hidden>
- Date: Mon, 12 Dec 2005 15:35:36 +1000
Hiya,
I'm trying to create a script that will
automate the print to PDF process for both FreeHand MX and QuarkXPress
documents.
I've written a script that tests for
the file type and opens the file into the right app. For Quark I have to
use "Export to PDF" as the Print menu is broke under 10.4 but
under Freehand the script invokes the print dialog and will save off a
PostScript file. I'll then have the resulting .ps file distilled as either
a HiRes or LowRes PDF depending on a user dialog response.
I'm at the point of trying to set up
the Print options for FreeHand and have been reading about UI scripting.
I've kept a few good examples of UI scripting sent to the AS list recently
and have done some reading and downloaded both the UI Element Inspector
and the UI Browser apps but I'm still stuck.
I'm trying to select the "FreeHand
MX" menu item of the pop up button (1) of the Print window but nothing
is happening further than the Print window appearing.
Here's the code:
tell
application "FreeHand MX"
activate
tell
document 1
print
tell
application "System Events"
tell
process "FreeHand MX"
click menu item "FreeHand MX" of
pop up button 1 of
window "Print"
end
tell
end
tell
end
tell
end
tell
I'll keep adding the UI commands as
I get these preceding ones working.
Any pointers???
Ta muchly,
Cojcolds
ps. when and how do you use the AX actions?
I've seen them in a few scripts on the list but how do they differ from
say the click command etc.?
pps. I strangely have a ghost of the
"Copies & Pages" pop up that won't go away since trying these
(as well as the perform action AXPress). No doubt a reboot will clear it
but I've never seen remnants hang around like this under OSX before. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden