Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Cancel's CustomAlias Plugin for Colloquy VERSION 1.0.0
- --Jason T. Powell jtpowell@users.sourceforge.net
- --PREFERENCES
- property service : true -- true/false:
- on run
- display dialog "Don't run me, move me to ~/Library/Application Support/Colloquy/PlugIns/ and type /reload plugins in Colloquy."
- end run
- using terms from application "Colloquy-1"
- on load
- --if we did something on load it would be here
- end load
- on idle
- --if we had an idling stuff it would go here
- --return 500
- end idle
- on unload
- --stuff to do when we unload goes here
- end unload
- on build contextual menu for item customAlias in view
- --display dialog class of view
- --check if item is a member or chat room
- if class of customAlias is chat room panel or class of customAlias is Unicode text then
- my buildCustomAliasMenu(view)
- end if
- end build contextual menu for item
- on handle clicked contextual menu item menuTitle for room
- if menuTitle begins with "Enable Custom Aliases" then
- set service to true
- else if menuTitle begins with "Disable Custom Aliases" then
- set service to false
- else if menuTitle begins with "About Custom Aliases Plugin" then
- my aboutCustomAliases()
- end if
- end handle clicked contextual menu item
- on process user command c with arguments for view
- if service is true then
- set thePListPath to POSIX path of (path to home folder) & "Library/Application Support/Colloquy/PlugIns/CustomAliases"
- try
- tell application "System Events"
- tell property list file thePListPath
- tell contents
- set customCommand to value of property list item c
- end tell
- end tell
- end tell
- send raw command customCommand to connection of view
- end try
- end if
- end process user command
- end using terms from
- on buildCustomAliasMenu(view)
- if service is false then
- return {title:"Custom Aliases", submenu:{{title:"Enable Custom Aliases", enabled:true, context:view}, {title:"Disable Custom Aliases", enabled:false}, {title:"About Custom Aliases Plugin..."}}}
- else if service is true then
- return {title:"Custom Aliases", submenu:{{title:"Enable Custom Aliases", enabled:false}, {title:"Disable Custom Aliases", enabled:true, context:view}, {title:"About Custom Aliases Plugin..."}}}
- end if
- end buildCustomAliasMenu
- on aboutCustomAliases()
- tell application "Finder" to open file ((path to application support folder from user domain as Unicode text) & "Colloquy:Plugins:CustomAlias.scpt")
- tell application "Safari"
- activate
- set the URL of document 1 to "http://cancelbot.sourceforge.net"
- end tell
- end aboutCustomAliases
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement