AIR TextMate Bundle
Updated: 10-Apr 2008
I should really add now that I spotted a couple of mistakes in the bundle which have been fixed. If anyone uses this and spots anything amiss - let me know and I'll sort it.
I've just finished attending the AIR tour and during the final (particularly funny) presentation, I completed a TextMate plugin that has full API completion support.
It was scraped from the JavaScript API reference pages.
I'll post more info that I've learnt - and probably turn the API scrapper (via jQuery) in to an AIR app if anyone wants it.
You should follow me on Twitter here I'll tweet about JavaScript, HTML 5 and other such gems (amongst usual tweet-splurges)
Just getting started with AIR myself (not sure whether I'll be using mainly Flex or Ajax as I'm interested in both routes) and came across the bundle.
I can't get the Package Preview command to work for some reason, it keeps giving me a tooltip with "descriptor not found" even though I can demo just find using adl from command line. I've gone and made sure I have it installed in the same directory I see listed in the bundle (/Applications/AdobeAir, which of course has it in its bin/) and no luck.
Any ideas? It'd be nice not to have to run the cmd line every time.
[...] I use TextMate and Remy Sharp’s AIR TextMate Bundle to develop Adobe AIR applications. Haven’t tested Adobe’s Flex Builder, but it seems [...]
Here's a suggestion (or two)...
How about some global preference variables for pointing to the AIR bin location?
And a project variable for pointing to the application descriptor file.
For example, I've changed my "Package Preview" command to this:
export PATH=$PATH:$TM_AIR_BINexport CLASSPATH=$TM_AIR_ADT
adl "$TM_PROJECT_DIRECTORY/$TM_AIR_APP_DESC"
Then, in TextMate > Preferences > Advanced > Shell Variables, I set up TM_AIR_BIN to my AIR sdk bin folder, and TM_AIR_ADT to my AIR sdk's adt.jar
Then in each project, I create a "Project specific shell variable" for TM_AIR_APP_DESC and plug in that project's AIR app descriptor file.
Similar changes can be made to the "Package Self-signed" command.
The thing I'm struggling with now is how to let TextMate know that I'm in ActionScript 3, but also AIR...maybe a dummy language grammar that simply extends AS3's grammer, but scopes you for AIR, so we can remap Command-R and Command-B to the "run" and "build" commands...?
Why I found another textmate bundle, that seem to be identical but with another author:
http://www.towerkraut.com/adobe-air-textmate-bundle/#comment-2134
@Hiruma - I think you'll find there is a difference, and in fact the reason I posted it up - my version includes code completion for all the JavaScript API, otherwise the signature and build stuff is pretty much identical.
Hi... here's my version of the "Preview Package" command, which detaches the adl process from TextMate, so you can continue working in TextMate while the AIR app is running:
#!/usr/bin/env ruby -wKU
require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/detach"
TextMate.detach { `adl "#{ENV['TM_PROJECT_DIRECTORY']}/application.xml"` }
This assumes "adl" is in your PATH; something you can set in the TextMate preferences if necessary. The latest TextMate builds do not source your .bashrc files when running a Ruby command like this. I've also noticed that setting CLASSPATH is unnecessary; adl can find the .jar file relative to where it lives.
Oh, and you lose the tooltip response with this, but I've never found that particularly useful. I always use the AIR Introspector dialog myself.
Thanks for this.
@nick, make sure your project has the application.xml file at the root level, otherwise the bundle will give you the "application descriptor not found" message you're seeing.