opensubscriber
   Find in this group all groups
 
Unknown more information…

a : applescript-users@lists.apple.com 18 January 2006 • 2:53PM -0500

Re: UI referencing a window by number not name
by Mark Butler

REPLY TO AUTHOR
 
REPLY TO GROUP




Hey Brett,

Before you waste a bunch of time like I did... I couldnt click the  
print button in Quark so GUI scripting the print dialog was a waste  
of time. Quark's print command is broken in Tiger so scripting that  
dosent work. Even before Tiger you couldnt set a custom page size  
without editing the ppd and taking all the page sizes out. This work  
around uses the export pdf. You can set the pdf export to only go to  
ps so it is somewhat useable although I have seen some problems with  
images in certain rips. You can set in the preferences of Quark to  
use a post processor for the pdf's so I dont think this touches Jaws  
(pdf engine Quark uses) at all.

I picked this up somewhere think it was the Quark forums...

on UI_export()
tell application "QuarkXPress Passport"
activate
end tell
try
tell application "System Events"
tell process "QuarkXPress"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
tell menu item "Export"
tell menu "Export"
click menu item "Layout as PDF..."
end tell
end tell
end tell
end tell
end tell
delay 1
tell window "Export as PDF"
keystroke (ASCII character 13)
end tell
end tell
end tell
on error
display dialog "UI not working"
end try
end UI_export

Good luck with that freehand thing... Would love to hear what you  
find out I dont run across those files very often but.. Would be nice  
to have something in my bag for it...

Mark



On Jan 17, 2006, at 9:43 PM, Brett Conlon wrote:

>
> Hiya,
>
> Scripting is becoming a love/hate relationship... especially when  
> UI scripting and Apps that are AS half-baked AS are involved. Then  
> again, it's probably just me!  ;-D
>
> How does one reference a window without having to use the exact name?
>
> I have 2 instances (Quark & FreeHand) where I need to reference a  
> window but the window name is not static, it changes depending on  
> the document name.
>
> Example 1 (QuarkXPress Print window):
>
> If I use the following it works:
>
> click (menu item "A4 Portrait" of menu of pop up button 1 of window  
> "Print Layout 1")
>
> In this case the Layout window in the XPress document is called  
> Layout 1, therefore the Print window is "Print Layout 1". If the  
> XPress Layout window was "Dog" then the Print window would be  
> "Print Dog"
>
> I tried the following but it doesn't like it:
>
> click (menu item "A4 Portrait" of menu of pop up button 1 of window 1)
>
> In desperation I even tried in vain:
>
> click (menu item "A4 Portrait" of menu of pop up button 1 of window  
> whose name starts with "Print")
>
> Example 2 (FreeHand's main window)
>
> I'm simply trying to get the value of the field that sets the  
> documents units at bottom left (Millimetres/Pixels/etc). This works:
>
> get name of pop up button 1 of UI element 8 of window "FHMX Test"
>
> But if I use this it fails:
>
> get name of pop up button 1 of UI element 8 of window 1
>
> In each case I'm using the element reference that is shown in UI  
> Browser.
>
> Is there a special knack to this?
>
> Cheers,
>
> Cojcolds
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list      (Applescript-
> users@list...)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/applescript-users/markusca%
> 40mac.com
>
> This email sent to markusca@mac....

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (Applescript-users@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/subscriber%40opensubscriber.com

This email sent to subscriber@open...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.