[TxMt] Re: Changing the Script Editor

Jacob Rus jrus at hcs.harvard.edu
Thu Nov 16 18:26:58 UTC 2006

Adam Bell wrote:
> It seemed 
> to me that I could substantially automate several things I do with it in 
> a much more direct fashion than is possible with SD4.

Yes indeed.  The problem with SD, as with most language-specific 
editors, is that they by their nature cannot allow as much interesting 
general behavior as all-purpose editors.  Which is why most people use 
all-purpose editors most of the time.  Having the same powerful tools 
available in every language is really nice.  That's not to say that 
specific editors can't be useful, of course.

> interested in Cameron Hayne's development of ASH (AppleScriptShell); 
> http://www.hayne.net/MacDev/Ash/

I'm not sure whether this makes me want to puke, or whether I think it's 
really cool.  Maybe some of each :p.  The idea of using applescript 
interactively, through a perl script, that does some weird voodoo, and 
has a few of its own odd extensions, is a bit unsettling.  Maybe I'll 
feel ambitious enough to try this out sometime.  One of the real 
problems is that given AppleScript's dependence on bizarre 
scope-specific stuff, interpreting AppleScript real-time is not really 
possible.  But I sure do wish that Apple had tried to make their 
language usable interactively.  The interactive shell in python is often 
very useful for testing out ideas.

> But what makes Script Debugger so powerful is the amount of information 
> about what's going on that it reveals, and it's very handy palettes.

Hmm, is there anything here you think we should try to steal?  What's 
handy in the palettes?  Have you tried any TextMate snippets?  The 
applescript bundle has some cool ones.  When I get around to a 
screencast showing it off, I'll try to show how they work.

>> because AppleScript is too stupid to understand UTF-8 *.applescript 
>> files.  [...]  or else either convert things to 
>> macroman before running them, or just avoid non-ascii characters (like 
>> ¬).
> ¬ is an acceptable character in the Script Editor and SD4.

Yes, but it's not ascii, so if you save a utf-8 *.applescript file with 
a ¬ in it, and then try to run it with osascript, you'll get a big fat 

> My purpose isn't very clear to me either. TextMate seems very powerful 
> and flexible and I wanted to explore what it could do. I didn't even 
> know it supported AppleScript until I first ran it; I was more 
> interested in formatting a series of articles for the web that contain 
> embedded AppleScripts (I edit the cover of http://macscripter.net), and 
> was curious whether I could do a better job of formatting the AS than 
> the tag engine on the site does (MacScripter and its forum understand 
> [applescript], [/applescript] tags and format the script with a link 
> that will download it directly to the user's default script editor).

Well, you should be able to make a grammar for that forum that can 
correctly apply syntax highlighting to things in [applescript] tags (and 
let you use all the handy applescript snippets, etc.) then.  If it's 
just bbcode otherwise, you could easily extend the existing bbcode 
grammar to do this (or we could even put it in everyone's bbcode bundle, 
as I doubt anyone else uses [applescript] to mean something different).

> Ahh, but I'm an amateur - a retired Dean of Engineering so I don't know 
> any of those except a smattering of bash. I did teach for a bunch of 
> years in your neighborhood, though - Just down Mass Ave at MIT - left to 
> come here in Admin.

You still live around here?  [off-topic: If there are other boston-area 
TM users, it would be neat to do a meetup sometime.]

> I've got 28 more days to play - hopefully I'll get time to explore.

Let's hope longer than that!


More information about the textmate mailing list