Changes between Version 7 and Version 8 of Documentation/AppleScripting


Ignore:
Timestamp:
Feb 25, 2010 8:32:39 AM (8 years ago)
Author:
jubesz
Comment:

Added applescript for throttled /joins

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/AppleScripting

    v7 v8  
    5252When writing [wiki:Development/PlugIns/AppleScript AppleScript PlugIns], the target for a message is often provided as an optional parameter to the handler. For example the callback 'process incoming chat message' sends a parameter 'in', which you can use to (for example) reply to the source of the incoming message. 
    5353 
     54This example can be used to join rooms in a throttled fashion so you don't get kicked for excess_flood 
     55{{{ 
     56tell application "Colloquy" 
     57        (* Change these to your rooms *) 
     58        set rooms to {"#colloquy", "#xchat", "#unix"} 
     59        (* get connection object *) 
     60        (* set connection to first connection of application *) 
     61        tell connection 1 
     62                (* join the rooms *) 
     63                repeat with room in rooms 
     64                        join chat room room 
     65                        delay 1 
     66                end repeat 
     67        end tell 
     68 end tell 
     69}}} 
     70[applescript://com.apple.scripteditor?action=new&script=tell%20application%20%22Colloquy%22%0D%09%28%2A%20Change%20these%20to%20your%20rooms%20%2A%29%0D%09set%20rooms%20to%20%7B%22%23colloquy%22%2C%20%22%23xchat%22%2C%20%22%23unix%22%7D%0D%09%28%2A%20get%20connection%20object%20%2A%29%0D%09%28%2A%20set%20connection%20to%20first%20connection%20of%20application%20%2A%29%0D%09tell%20connection%201%0D%09%09%28%2A%20join%20the%20rooms%20%2A%29%0D%09%09repeat%20with%20room%20in%20rooms%0D%09%09%09join%20chat%20room%20room%0D%09%09%09delay%201%0D%09%09end%20repeat%0D%09end%20tell%0Dend%20tell Click here to open the script in Script Editor.] 
     71 
     72 
    5473== Opening The Dictionary == 
    5574All !AppleScriptable applications provide 'dictionaries' of scripting terminology, describing the various classes of object and their relations to each other, commands and callback handlers. As with any other scriptable application, to see Colloquy's !AppleScript dictionary from within Script Editor use "File" -> "Open Dictionary", then select Colloquy from the list.