• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UI referencing a window by number not name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UI referencing a window by number not name


  • Subject: UI referencing a window by number not name
  • From: Brett Conlon <email@hidden>
  • Date: Wed, 18 Jan 2006 15:43:41 +1000


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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: UI referencing a window by number not name
      • From: Mark Butler <email@hidden>
  • Prev by Date: Re: Pages 2.0 Scripting
  • Next by Date: Re: UI referencing a window by number not name
  • Previous by thread: Re: Scripting Internet Connection
  • Next by thread: Re: UI referencing a window by number not name
  • Index(es):
    • Date
    • Thread