Re: world's largest AppleScript dictionary
Re: world's largest AppleScript dictionary
- Subject: Re: world's largest AppleScript dictionary
- From: has <email@hidden>
- Date: Tue, 14 Sep 2004 22:00:29 +0100
steve harley wrote:
on 14 Sep 2004, at 9:11 AM, Paul Berkowitz wrote:
Word 2004 has the surely the largest (and arguably
the oddest) AppleScript dictionary on earth.
how large is it? i don't have it, nor is there a PDF at
<http://macscripter.net/app_dictionaries/>
but the InDesign CS PDF there runs 253 pages ...
anyone have a methodology for an empirical count? i could try build a
tool in Python if interested
The following Python script will produce a basic tally:
#######
#!/usr/local/bin/pythonw
from osaterminology import parse, Receiver
class Counter(Receiver):
def __init__(self):
self.suites, self.classes, self.commands = 0, 0, 0
def start_suite(self, *args):
self.suites += 1
def start_class(self, *args):
self.classes += 1
def start_command(self, *args):
self.commands += 1
def count(path): # path = full path to application
c = Counter()
parse(path, c)
print 'Suites: %i, Classes: %i, Commands: %i' % (c.suites,
c.classes, c.commands)
# TEST
count('/Applications/TextEdit.app')
# -> Suites: 3, Classes: 24, Commands: 13
#######
Requires the osaterminology package from my site; see:
<http://freespace.virgin.net/hamish.sanderson/appscript.html>
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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