Menu

Messages

PHPdev32

Sample AppleScript for Messages

~~~~~~~
on resize(dly)
delay dly
tell application "Messages" to set zoomed of window "Buddies" to true
end resize
on notify(notes)
tell application "EnCee" to notify ttle of notes with message desc of notes imitate "Messages"
end notify
using terms from application "Messages"
on setMsg(bStatus)
if (bStatus is offline) then return "disconnected"
if (bStatus is available) then return "connected"
if (bStatus is away) then return "went away"
if (bStatus is idle) then return "became idle"
return "no"
end setMsg
on buddy became available bddy
if application "Messages" is not frontmost then tell application "Messages" to my notify({desc:my setMsg(status of bddy), ttle:full name of bddy, icon:image of bddy})
resize(1)
end buddy became available
on buddy became unavailable bddy
if application "Messages" is not frontmost then tell application "Messages" to my notify({desc:my setMsg(status of bddy), ttle:full name of bddy, icon:image of bddy})
resize(2.5)
end buddy became unavailable
on completed file transfer trnsfr
if (application "Messages" is frontmost) or (transfer status of trnsfr is not finished) then return
if direction of trnsfr is incoming then
set dir to "Sent"
else
set dir to "Received"
end if
tell application "Messages" to my notify({desc:dir & " " & (file of trnsfer as string), ttle:full name of bddy, icon:image of buddy of trnsfr})
end completed file transfer
end using terms from
~~~~~~~~~