Aptana’s Snippets

Over the weekends, I was trying to learn the ways on how to work faster without typing much codes and minimizing errors. The solution is learning to use Aptana’s Snippet View. Firstly, before we start – I would like to suggest rearranging your IDE into more simpler view.

I like to close unwanted views and combine three of my mostly used View into ones dock to the left side of the IDE namely, File, Project and Snippets.


Let’s move on, we will then need to create our own set of snippets – be it JS script, XML, HTML, CSS or whatever you are programming with this IDE.

First, create a new default web project. For this tutorial – I’m going guide you all in writing your first Javascript Alerter with user input support. Name the project Aptana Snippets. Proceed by creating snippets folder inside this project.


Now, inside the snippets folder add an empty js file. Let’s called it myMsgBox.js

DELETE everything including remarks statement generated by Aptana in myMsgBox.js

Type in the javascript like below for example.

	category: Titoonic
	name: My Message Box
	toolbar: true
	language: text/javascript
	toolTip: My Message Box
	prompt(msg): Message

Notice, the remarks are very context specific – which means you have to make sure you follow Aptana IDE snippet remark syntax to bind them to snippet view. Category : means the folder that will appear in Snippets View. You should create your own Category because, there’s a lot of snippets categories in there already – best to start one your own to avoid confusion.

Notice there’s also prompt(variablename): Title, by inserting this – you can assign variables to the actual snippet with {$variablename}. In our case {$msg} was our variable name. You can add more than one variable name by adding more prompt{variablename} : Title and matching it with the codes.


Once, you save – Aptana will create a reference based on your remark statement and update the Snippet view. Please make sure no space are above the remark statement – else it will not work.