• 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: Exists command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exists command


  • Subject: Re: Exists command
  • From: kai <email@hidden>
  • Date: Wed, 3 Jan 2007 12:53:48 +0000


On 3 Jan 2007, at 11:51, Axel Luttgens wrote:

On 3/01/07 11:26, kai wrote:

[...]
Yeah, I noticed that, too, Axel. But just to avoid any ambiguity, 'exists' is actually a general application command that determines whether the object specified by a reference exists. So it works in Finder, as well as elsewhere. ;-)


For example:
----------------

tell application "TextEdit"
    exists window 1
end tell

----------------


Hello Kai, nice to meet you again.

Likewise, Axel.

You are right: the ASLG defines 'exists' as a standard application command, yet without telling it is a required one.
My understanding is that one may not take for granted that any application implements it.
But I was sure about the Finder, without ambiguity. ;-)


Now, the fact is that more and more scriptable applications tend to include 'exists' as a command, mainly as a benefit of Cocoa's built- in support for it.

Quite. Although applications should support required commands like 'open', 'print', 'quit', 'run', and 'reopen' (previously listed in a separate Required suite), they may support different commands in the Standard suite. As you say, Cocoa seems to be providing greater consistency. So, while some applications (such as Terminal) don't explicitly declare the Standard suite in their dictionaries, they can still support commands like 'exists'.


Happy new year to all,

And a hearty ditto from this corner. :-)

PS: Hopefully, the attempt to adopt a more conventional syntax in the above script example goes some way towards appeasing the grammarians. However, since adopting convention still appears to be absent from my list of new year resolutions, a tendency to backslide into something like 'tell application "TextEdit" to window 1 exists' still 'exists'... ;-)

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: AppleScript-Users Digest, Vol 4, Issue 2 (From: Barry Wainwright <email@hidden>)
 >Re: AppleScript-Users Digest, Vol 4, Issue 2 (From: Axel Luttgens <email@hidden>)
 >Re: Exists command (was: AppleScript-Users Digest, Vol 4, Issue 2) (From: kai <email@hidden>)
 >Re: Exists command (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: AppleScript-Users Digest, Vol 4, Issue 2
  • Next by Date: Re: Mail.app "reply" verb returning nothing
  • Previous by thread: Re: Exists command
  • Next by thread: Re: Exists command (was: AppleScript-Users Digest, Vol 4, Issue 2)
  • Index(es):
    • Date
    • Thread