Apache and AppleScript
Subject:   Re: Glaring Error
Date:   2005-02-12 15:14:09
From:   has01
Response to: Re: Glaring Error

"""So to be completely correct I should've used the term "OSAScript-aware languages and extensions can be used to accomplish...""""

In fact, interpreted/compiled languages don't even need OSA support to script applications, just a bridge to the Apple Event Manager's C-based API. e.g. I always use the standard MacPython framework and pythonw command-line interpreter; no osascript involved.

There are basic OSA language components for Perl, Python and others, but all this actually gives you is the ability to edit and run scripts in OSA-based editors like Script Editor and attach them to applications that support attachability.

Extremely cool technologies, btw, though often not very well explained or documented by Apple which I think causes a lot of the confusion.

"""The projects that you mentioned above are exactly what I was referring to when I wrote "However, the HFS(+) filesystem also uses resource forks to store metadata for files, which 'traditional' languages can't access without special methods.""""

I wouldn't describe a quick trip to CPAN or PyPI to install a new module package as uncommon or unusual in any way, but that's by-the-by. In any case, it was another paragraph I was commenting on - see below.

BTW, can't mind where comments are stored in OS X, but it's not individual files' resource forks (OS9 used the Desktop DB). Though the Carbon File Manager API includes functions for accessing comments if you don't want to script Finder.

"""I decided to gloss over those details because I didn't feel they were necessary to the point that I was trying to get across at that stage in the article: that AppleEvents provide a much richer method of passing data back and forth than plain-text streams through standard input/output."""

Absolutely; Apple event-based IPC is a great technology that doesn't get nearly as much attention as it deserves, so it's always a welcome sight when O'Reilly covers it. However, your article didn't so much 'gloss over' (which is fine) as say it couldn't be done:

<blockquote>"Through [AppleScript] you can gain access to information that is inaccessible to the cross-platform scripting languages (or even high-level languages such as Java and C's derivatives) mentioned above."</blockquote>

Which is an error, not an omission, as any language that can talk C can access this info - and quite a few already provide low-, mid- and/or high-level bridges for this purpose. Hence the correction. :)

"""As for the broken zip file, it was created using Panther's "Create Archive" command from within the Finder [...] My apologies."""

No worries. I think Apple in their forward charge sometimes forget their more poverty-stricken users can't always keep right up. Server seems down right now but I'll try again later, thanks.