| Home | Podcast Feed | Vote For Me On Podcast Alley | Merchandise | What Is Podcasting? |


« I Need Some Help With Applescript | Main | It's Here »

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 April 10, 2005 05:11 PM

Trackback Pings

TrackBack URL for this entry:
http://www.everythingdigital.org/cgi-bin/mt-tb.cgi/160

Listed below are links to weblogs that reference iChatNotifyBT:

» iChatNotifyBT from MAKE: Blog
I'm going to use [Read More]

Tracked on April 18, 2005 03:54 AM

» cricket scores from cricket scores
cricket scores [Read More]

Tracked on March 20, 2006 12:34 AM

Comments

nice work- i'll post a link to this up on make. if you have time, take a photo of it in action and throw it on up in the make group pool...

cheers,
pt

Posted by: pt at April 10, 2005 05:37 PM

Wow, this is awesome. So, the correct usage is to load the script (e.g. double click) to "arm" the notification trigger, right? And then it is supposed to happen exactly once after that? I happen to have the same phone as you (V600) and I did indeed get the notification working. The address book entry is deemed corrupt by the phone, so I can't tell who's IMing, but still it's very handy.

Posted by: Peter at April 23, 2005 10:25 PM

You have the usage right, I decided one-time notification was better, since you can always arm it again, and that way you don't get flooded with notifications if you're away for a while.

The script isn't able to put the name of the person that is IMing yet anyway, so you aren't missing out there.

Thanks for giving it a try and I'm glad you find it useful!

Posted by: Alan Joyce at April 23, 2005 10:31 PM

Post a comment




Remember Me?