Advertisement
Guest User

Untitled

a guest
Jun 14th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on getUrl()
  2.     tell application "System Events"
  3.         if ((application processes whose (name is equal to "Safari")) count) is greater than 0 then
  4.             using terms from application "Safari"
  5.                 tell application "Safari"
  6.                     set link to URL of current tab of front window
  7.                     return link
  8.                 end tell
  9.             end using terms from
  10.         else
  11.             return ""
  12.         end if
  13.     end tell
  14. end getUrl
  15.  
  16. on getTitle()
  17.     tell application "System Events"
  18.         if ((application processes whose (name is equal to "Safari")) count) is greater than 0 then
  19.             using terms from application "Safari"
  20.                 tell application "Safari"
  21.                     set title to name of current tab of front window
  22.                     return title
  23.                 end tell
  24.             end using terms from
  25.         else
  26.             return ""
  27.         end if
  28.     end tell
  29. end getTitle
  30.  
  31. using terms from application "Colloquy"
  32.    
  33.     on process user command cmd with args for whichPanel
  34.         if cmd is equal to "www" then
  35.             tell whichPanel
  36.                 send message (my getUrl())
  37.             end tell
  38.         else if cmd is equal to "www2" then
  39.             tell whichPanel
  40.                 send message (my getTitle() & " - " & my getUrl())
  41.             end tell
  42.         end if
  43.     end process user command
  44.    
  45. end using terms from
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement