MACSCRPT Archives

February 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sun, 17 Feb 2008 17:00:46 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
Christopher Green wrote:

> One of the things AS spoiled me with from early on is
> "whose clauses" (apparently also known as the by-test
> reference form). My question is, for those of you who
> reeeeally know other scripting/programming languages,
> what other languages have this funcionality as a basic
> feature??

'Whose clauses' are a feature of individual scriptable applications,  
not of AppleScript itself, so any language with decent Apple event  
support can take advantage of them, e.g. [1]:

#!/usr/bin/python

from appscript import *

print app('Finder').home.items[its.name.beginswith('d')].name()

#-> [u'Desktop', u'Documents', u'Downloads']


HTH

has

[1] To install Python appscript on Leopard, just run the following  
command in Terminal:

	easy_install appscript
-- 
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

ATOM RSS1 RSS2