using terms from application "Colloquy" on load from scriptPath set scriptAlias to (POSIX file scriptPath) as alias set loadedScriptName to (name of (info for scriptAlias)) set msg to (loadedScriptName & " Loaded") as string set evt to (loadedScriptName & "loaded") as string tell active panel of front window add event message msg with name evt end tell end load on unload set msg to (loadedScriptName & " Unloaded") as string set evt to (loadedScriptName & "unloaded") as string tell active panel of front window add event message msg with name evt end tell set loadedScriptName to "" end unload on process user command c for view if c is "pandora" then tell application "System Events" set pandoraRunning to ((application processes whose name is equal to "PandoraBoy") count) is greater than 0 end tell if pandoraRunning then try tell application "PandoraBoy" set theTrack to name of current track set theArtist to artist of current track end tell tell view to send message "is listening to " & theTrack & " by " & theArtist & " (on Pandora)" with action tense on error tell active panel of front window add event message "Couldn't look up pandora track" with name "pandoraError" end tell return false end try else tell active panel of front window add event message "PandoraBoy isn't running" with name "pandoraError" end tell end if end if end process user command end using terms from