« April 08, 2005 | Main | April 12, 2005 »
April 10, 2005
iChatNotifyBT
After some careful troubleshooting I was able to work the bugs out of my iChatNotifyBT script, and I am now ready to fully release it. Again, this script is intended to work with iChat to detect new incoming messages, and send a notification (address book contact) to your bluetooth phone that the instant message has arrived. Many cellular carriers offer AIM forwarding services for mobile devices, however, they often use SMS and therefore cost per message. If your phone has bluetooth, why not take advantage of that functionality?
NOTE: You must first choose "None" in Bluetooth File Exchange preferences, and make sure the destination device is the only bluetooth device added to your favorites in bluetooth system preferences.
SCREENSHOTS: View [Flickr]
DOWNLOAD: iChatNotifyBT | iChatNotifyBT Source
--iChatNotifyBT v.b01
--Created by Alan Joyce
--http://everythingdigital.org
--Requires "None" to be chosen in Bluetooth File Exchange preferences, and the destination device to be the only bluetooth device that is added to favorites.
on notify()
tell application "Address Book"
set addressList to first name of every person
if addressList contains "NEW IM" then
set notifyCard to (get people whose first name is "NEW IM")
set notifyNow to item 1 of notifyCard
else
set addEntry to (make new person)
tell addEntry
set first name to "NEW IM"
end tell
set notifyCard to (get people whose first name is "NEW IM")
set notifyNow to item 1 of notifyCard
end if
end tell
set PathName to path to desktop
tell application "Address Book"
set cardName to "NEW IM"
set myCard to vcard of people where name is "NEW IM"
set vcardinfo to myCard as string
my makeExportFile(PathName, cardName, vcardinfo)
end tell
my sendit()
end notify
on makeExportFile(PathName, cardName, vcardinfo)
try
set target_name to cardName & ".vcf"
set target_file to (PathName as text) & target_name
tell application "Finder" to make new file at PathName ¬
with properties {name:cardName & ".vcf", creator type:"adrb"}
set the open_target_file to ¬
open for access file target_file with write permission
set eof of the open_target_file to 0
write vcardinfo to the open_target_file starting at eof
close access the open_target_file
on error theErrMsg number theErrNumber
return theErrNumber
end try
end makeExportFile
on sendit()
set PathName to path to desktop
set cardName to "NEW IM"
set target_name to cardName & ".vcf"
set vcardpath to (PathName as text) & target_name
tell application "Bluetooth File Exchange"
activate
delay 3
open file vcardpath
end tell
tell application "System Events"
tell application "Bluetooth File Exchange" to activate
delay 3
keystroke (ASCII character of 13)
end tell
end sendit
tell application "iChat"
set windowList to name of every window
set windowNum to number of items in windowList
repeat
delay 1
set windowList to name of every window
set windowNumNow to number of items in windowList
if windowNumNow is greater than windowNum then
my notify()
exit repeat
end if
end repeat
end tell
Posted by Alan Joyce at 05:11 PM | Comments (3) | TrackBack
I Need Some Help With Applescript
I am working on the release of iChatNotifyBT, a utility that sends a message to your bluetooth phone to alert you when you have an incoming iChat instant message. It works by creating a contact card in Address Book and then exporting that to a .vcf file on the desktop that it then tells Bluetooth File Exchange to send. As commented in the code, I am having a bit of trouble with the Bluetooth File Exchange part. If you might know what could be wrong, feel free to download the .scpt file and send any corrections to me. Thanks to anyone who can help!
Posted by Alan Joyce at 12:08 AM | Comments (0) | TrackBack