• 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
Re: Is app running?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is app running?


  • Subject: Re: Is app running?
  • From: deivy petrescu <email@hidden>
  • Date: Mon, 9 May 2005 09:06:01 -0400


On May 8, 2005, at 18:35, Bill Cheeseman wrote:


No, your script is syntactically correct. Unfortunately, the AXURL attribute
of a Dock item is returned as a URL object (Cocoa's NSURL? Carbon's CFURL?
-- I'm not sure, as I sit here), and GUI Scripting doesn't seem to know how
to decompose or translate it into a string. I'm not sure if a consistent
convention has been established within Apple as to how to return AXURL
attributes (see below for Safari's approach, which differs from that of the
Dock). If you look at the AXURL attribute of a Dock item in PreFab UI
Browser or Apple's UI Element Inspector (Accessibility Inspector in Tiger),
you'll see that the value of the URL is in fact a file URL representing a
URL of the form <file://localhost/....>. But you don't seem to be able to
access it in GUI Scripting.


In other applications (Safari is the only one I've tried, but Mail and
TextEdit are likely the same), an AXURL object is an attribute of a
clickable Web link, and it is returned as a string that GUI Scripting can
access. For example, if you use UI Browser to navigate the UI elements in a
Safari page that has clickable links, you'll find that the links are
"AXLink" UI elements, and that one of an AXLink's attributes is an "AXURL"
attribute of type string (speaking loosely). For example,
"http://googleblog.blogspot.com/";. A GUI Scripting reference to it looks
like this, and in Safari it DOES work (watch for line wrap in the middle):


tell application "System Events"
tell process "Safari"
get value of attribute "AXURL" of UI element "Google Blog" of group
4 of UI element 1 of scroll area 1 of group 4 of window "About Google"
end tell
end tell


--

Bill Cheeseman - email@hidden

Bill, thanks for explanation and for yet another pointer, Accessibility Inspector. AI is different than the UI browser and has a nice companion, which I'll use to see if I can get AXURL to make any sense.


However, I tried AXURL in Safari and it does not have one. Mail does, but Safari does not. Actually in Safari I have:
"<AXLink: “Accessibility Programming Guidelines for Carbon”>
<AXStaticText>"


That is, AXLink is a superclass of AXStaticText. AXStaticText does not have AXURL as an attribute, but it does have an action attached to it, namely AXPress.

The normal text in the web page, that is, the non link text, does not belong to the AXLink class and, thus, it does not have an action associated with it.

Now, Mail on the other hand has the behavior you described and so does TextEdit. Do you really get the behavior you described in Safari. Did your script work?

On my end, the results are quite different.
Running Tiger (as I gather you knew) on a G4 machine.

Thanks



deivy petrescu
email@hidden


_______________________________________________ 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: Is app running?
      • From: Bill Cheeseman <email@hidden>
References: 
 >Re: Is app running? (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: POSIX file wierdness
  • Next by Date: Re: Nice Automator article on O'Reilly
  • Previous by thread: Re: Is app running?
  • Next by thread: Re: Is app running?
  • Index(es):
    • Date
    • Thread