Launch character palette using AppleScript in Snow Leopard

December 6th, 2009
tell application "CharacterPalette" to activate

There is an issue though: the new character palette doesn’t get “bound” to any of the applications, therefore double-clicking a symbol doesn’t paste it automatically to the text field. You’d have to drag-and-drop.

I’m posting this because most results from Google were telling me to launch a “.component”, and that “.component” doesn’t exist on my Snow Leopard system.

Restrict page access to authorized MODx managers only

December 6th, 2009

A while ago I needed to create a private zone with documentation, accessible only by the MODx managers. In order to restrict access I wrote a simple snippet, which you can now use as well.
Read the rest of this entry »

Add an <option> to a <select> using Mootools

December 6th, 2009
var newoption = new Option("option html", "option value");
try
{
	$('myselect').add(newoption, null);
}
catch (err)
{
	$('myselect').add(newoption);
}

To select the newly created option:

newoption.setProperty('selected', 'selected');