on run tell application "ircle 3.1.2 OS X" if not (exists (argument 1)) then echo serverprefix & " Usage: /j []" echo serverprefix & " Joins specified channel (of optional connection)" return end if try set chan to (argument 1) as text -- optionally set which connection if defined try if (exists (argument 2)) then set conn to (argument 2) as number else set conn to currentconnection end if on error set conn to currentconnection end try if conn is greater than 0 and conn is less than 11 then type "/join " & chan in connection conn else echo serverprefix & " ERROR attempt to connect to invalid connection number " & conn & " in /j" end if on error msg number num echo serverprefix & " ERROR " & msg & " (" & num & ") in script /j" end try end tell end run