ActionScript syntax colouring in Xcode

2 minute read Published:

(New: see also ActionScript for TextMate)

I had this working previously in Project Builder, but the specification files were broken in Xcode. Thanks to the C# versions I found here, I’ve been able to update these for Xcode. This installer adds two files, ActionScript.pbfilespec and ActionScript.pblangspec to /Library/Application Support/Apple/Developer Tools/Specifications, adding ActionScript syntax colouring and code completion (press opt-esc) to Xcode.

Update: Sam Robbins updated ActionScript.pblangspec to include component methods and properties. The installer now installs this updated version.

Personally, I now prefer to use SubEthaEdit as an external Xcode editor for ActionScript, as SubEthaEdit’s in-build ActionScript mode adds functions as well as classes to its symbols popup (Xcode can only see classes).

Update: and if, as I do, you find the colours in SubEthaEdit’s built-in ActionScript mode a little too garish (who wants bright red { operators }?), here’s a replacement.

Just copy the unzipped ActionScript.mode file to SubEthaEdit’s internal Modes folder, either manually by control-clicking SubEthaEdit and choosing ‘Show Package Contents’, then copying the file to Contents/Resources/Modes (you might want to back up the old ActionScript.mode first) or with this script (assuming you unzipped the file to your desktop): mv ~/Desktop/ActionScript.mode /Applications/SubEthaEdit.app/Contents/Resources/Modes/ActionScript.mode

Correction: unless you want to replace the built-in version, copy the new ActionScript.mode file to one of:
<br /> ~/Library/Application Support/SubEthaEdit/Modes/<br /> /Library/Application Support/SubEthaEdit/Modes/<br /> /Network/Library/Application Support/SubEthaEdit/Modes/<br />