• 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: What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…)


  • Subject: Re: What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…)
  • From: Philip Aker <email@hidden>
  • Date: Sun, 14 Dec 2008 09:40:27 -0800

On 2008-12-14, at 06:01:46, Chris Page wrote:

Do you think this aspect could be made clearer with finer-grained syntax coloring?

As a matter of fact, I do. I've wanted that for years. But I think there's a lot more we could do than that.

In particular the separation of variables and subroutines.

Well, I was thinking the biggest win would be distinguishing command and parameter names.

That would be nice too.


But more to your point, there is no difference between a variable and a subroutine name in AppleScript. When you define a handler, it just defines a variable whose value is the handler, and you can set that variable to other values:

Yes I know but…

Which is not to say it's impossible, but it does mean AppleScript would have to figure out the current value of the variable to see if it's a handler while decompiling the script. It also means that it wouldn't necessarily be correct at every point within the program.

I could get used to a few anomalies very quickly.


tell application "Finder" to move (every file whose name ends with ".txt") to folder "Text Files"


Well:


mv *.txt 'Text Files'


:-) but I do know what you mean.

Okay, but please forgive me for using this to illustrate a point: This is exactly my other point about clarity versus saving on typing. Shell commands were designed to save on typing, because they're usually entered interactively by the user every time they wish to run a command. That mv shell command looks like gibberish unless you know your way around a Unix shell. And it can take some time to memorize “mv” and how “*” works, and the order of the arguments. But the AppleScript version is probably at least vaguely comprehensible to someone who's never seen AppleScript before in their life. In fact, it's practically exactly how you'd explain in English what the shell command does.

Well, I spent 12 years in Montreal starting at teenage-hood. Believe me, when you're seventeen and really horny, you don't care much which form the language of love takes -- only that it works!



Thanks for the comments. I'm kinda surprised that your remarks are mostly at the "high" level.

Well, at the low level all languages are identical. ;-) What sort of things were you expecting me to address?

OSA, how the Apple Event Object Model can subsume huge portions of XML without working up a sweat, the benefits of sdefs towards defining a modern AppleScript while still retaining huge portions of the original design…



Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
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/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…)
      • From: Chris Page <email@hidden>
References: 
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: has <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Chris Page <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Philip Aker <email@hidden>)
 >What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…) (From: Chris Page <email@hidden>)
 >Re: What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…) (From: Philip Aker <email@hidden>)
 >Re: What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…) (From: Chris Page <email@hidden>)

  • Prev by Date: Re: What's so great about AppleScript, anyway?
  • Next by Date: Re: What's so great about AppleScript, anyway?
  • Previous by thread: Re: What's so great about AppleScript, anyway?
  • Next by thread: Re: What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…)
  • Index(es):
    • Date
    • Thread