THE APPLICATION
I borrowed some stuff from Cocoa Objects to create a stay-open script that would detect the current iChat status and replace the buddy icon based on that status. Images reside in a pre-determined directory.
THE ERROR
I got my script working from the Script Editor. However, as soon as I save it as a stay-open application, I get this error when launching it:
“Could not run the script ‘iconStatusApp’ because of a program error. -1312”
I’m including my script (which has been stripped of any error trapping) to see if I’m just missing something really obvious.
THE SCRIPT
property pathToiChatIcons : "Macintosh HD:Users:(Change to your user folder name):Pictures:iChatIcons:"
property delayTime : 5
on run
tell application "iChat"
my displayIcon()
end tell
return delayTime
end run
on idle
tell application "iChat"
my displayIcon()
end tell
return delayTime
end idle
on displayIcon()
tell application "iChat"
if status is equal to available then
set activeIcon to (pathToiChatIcons & "available.tif")
else if status is equal to away then
set activeIcon to (pathToiChatIcons & "away.tif")
else if status is equal to idle then
set activeIcon to (pathToiChatIcons & "idle.tif")
end if
my iChatIconSetTiffImage(activeIcon)
end tell
end displayIcon
on iChatIconSetTiffImage(theImageFile)
tell application "iChat"
set theImage to open for access file theImageFile without write permission
set ImageData to read theImage as TIFF picture
set image to ImageData
close access theImage
end tell
end iChatIconSetTiffImage
THE THANKS
Thanks in advance to anyone who can help out with this.