Re: Applescript

[prev] [thread] [next] [lurker] [Date index for 2005/08/07]

From: Paul Mison
Subject: Re: Applescript
Date: 22:43 on 07 Aug 2005
On 07/08/2005 at 14:19 -0500, Peter da Silva wrote:
>How the hell do I add a file to iTunes using Applescript.
>
>I'm obviously holding my face wrong.

-    set theTrack to add theFile to thePlaylist
+    set theTrack to add (theFile as alias) to thePlaylist

There's something deeply baffling about the five thousand ways 
AppleScript handles file references. Just look at the difference 
between POSIX file, file and alias. Then sit in the corner and cry a 
bit.

>Or sometimes, it tells me Finder doesn't know how to add an alias to (the
>same kind of spew).

That's odd. Let me see... nope, works with an alias too.

>And, by the way, things like "item 1 of blah" are something Grace
>Hopper would have come up with. Or maybe it's Larry Wall's idea of
>what COBOL should be like. I haven't used COBOL in years, and I
>still remember how tired I got of "perform monkey-balls through
>smelly-swamp".

Would it help if I pointed out you can say "the first item of blah"? 
Somehow I suspect not.

>How about an Objective C scripting language, Apple? Something like:

Because Apple doesn't care about the jewel in its crown (come on, for 
all the AppleScript syntax is baffling, you point to anything 
anywhere else that comes close to the power that OSA allows you in 
terms of linking and connecting applications, even if you have to 
resort to System Events / GUI scripting, which is an evil, horrible, 
nasty hack) and instead is happy to put out gewgaws like Dashboard 
which use bloody Javascript, and which their own (much lauded) 
development environment can't actually build properly.

Note to editor: is this spicy enough to be hate yet?

Oh, and if you're really that bothered about AppleScript as the OSA 
language, have you considered appscript, the Javascript OSA component 
or Mac::Glue?

-- 
:: paul
:: blue coconut slush

Generated at 19:00 on 15 Sep 2005 by mariachi 0.52