*plug* http://helpdesk.zaz.net/tutor/ walks you through writing scripts incl aliases, popups and remotes.