Re: GUI applescripting FreeHand MX
Re: GUI applescripting FreeHand MX
- Subject: Re: GUI applescripting FreeHand MX
- From: Brett Conlon <email@hidden>
- Date: Mon, 6 Feb 2006 10:20:34 +1000
Hi Andrew,
You are experiencing the same frustrations
I've been beating my head silly over for the past few months.
I haven't as yet found a solution to
clicking those pesky tabs but I have a workaround that is at least getting
the scripts functioning reasonably well for me.
Here's what I've done... Use FreeHand's
"Print Settings" (click the plus sign at top right of the "Print
Setup" window in the Advanced button then name the setting) to set
up all of the print options you want (crops, rego, separations, etc). You
can even specify a page size preset (eg. A4/A3/Letter etc.). Then you choose
the appropriate Print Setting from the main Print window, without having
to even click on the advanced tab and go into the Print Setup window. This
may be all you need to get you on your way. However, there is one possible
glitch. If you aren't using preset paper sizes (eg. A4/A3/Letter etc) or
someone has previously chosen "Custom" size in the Paper Setup
tab for that document, the "Print Setting" that was chosen by
the script will have no control over changing the paper size to A4 or A3
or ANYTHING, it just remains "Custom". In my case sometimes our
designers print to our Xerox and uses preset paper sizes and other times
they create custom size PDF's for client approval throughout the production
process so this becomes a problem for us.
This is where you then have to get the
script to go into FreeHand's Advanced button to the "Print Setup"
window and click on the Paper Setup tab... and of course nothing is working
to get this tab to select… as you have found.
My workaround for this basically consists
of a test for a specific "element" inside the Paper Setup tab
that I can poll for its existence. If it is not there I added a repeat
that gets the computer to speak to the user requesting that they click
on the "Paper Setup" tab. This does, unfortunately, stop the
script from automatically flowing, requiring user intervention, but once
the tab is pressed the existence of the "element" can be validated
and the script continues on and does its thing.
The good thing from here is the next
time the script is run and the print dialog is invoked the Paper Setup
tab should still be active and the script can do what it needs to do without
user intervention.
Here's the snippet of my full script
that does what I described above (inside a System Events tell):
--
Enter FHs Advanced window
click button "Advanced..."
of
UI element 1 of
UI element UIV1 of
window "Print"
repeat
-- Wait until "Print Setup"
window appears
if
(exists window "Print Setup") then
exit
repeat
else
delay 0.1
end
if
end
repeat
repeat
--Select "Paper Setup"
tab
if
(exists checkbox "Transverse" of
UI element 1 of
UI element 2 of
window "Print Setup") then
exit
repeat
else
beep 3
say "Please select
the Paper Setup tab."
end
if
end
repeat
if
PaperSize is
"A4" then
click pop up button 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup" --
Paper Size menu
delay 0.1
click menu item "A4" of
menu of
pop up button 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup"
else
if
PaperSize is
"A3" then
click pop up button 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup" --
Paper Size menu
delay 0.1
click menu item "A3" of
menu of
pop up button 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup"
else
click pop up button 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup" --
Paper Size menu
delay 0.1
click menu item "A4" of
menu of
pop up button 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup"
delay 0.1
click pop up button 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup"
delay 0.1
click menu item "Custom" of
menu of
pop up button 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup"
delay 0.1
set
Height to
get
round ((value of
text field 1 of
UI element 5 of
UI element 1 of
UI element 2 of
window "Print Setup") as
number) rounding to nearest
set
newHeight to
(Height + 20) as
text
keystroke tab
keystroke tab
keystroke "a" using {command down}
repeat
with
aChar in
characters of
newHeight
keystroke aChar --Type
in new height
delay 0.1
end
repeat
keystroke return
end
if
Of course, at the end it references
a prompt asked earlier about what paper size the user wants but basically
that should help you some.
If you do ever find a way of clicking
those tabs please share it with the list! 8-}
Regards,
Cojcolds
Andrew Bush <email@hidden>
Sent by: applescript-users-bounces+brett.conlon=email@hidden
02/02/06 10:38 PM
|
To
| AppleScript Users <email@hidden>
|
cc
|
|
Subject
| GUI applescripting FreeHand MX |
|
Hi all,
ok, in FreeHand, when you are in the print dialog you can choose
FreeHand MX in the popup and then click on the 'Advanced' button and
you get a separate 'Print Setup' window.
phew.
On that print setup window there are 3 'tabs' on the right hand side,
if you click on the third one you get a set of options that I need
access to.
<snipped>
Yours cheerfully,
Andrew Bush
_______________________________________________
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