mail script

yes, i am a n00b to applescripting. but you gotta start somewhere, right??

so here’s the issue:

i have 3 accounts on my mail app - 2 are hotmail accounts i get with the httpmail filter, 1 is a pop mail account. i wrote this script to tell me how many emails i get on one of the hotmail accounts (it gets activated by a rule). thing is, i can’t get the script to recognize the account.

property theAccount : "hotmail"
tell application "Mail"
	set unreadCount to unread count of theAccount
	tell application "iTunes"
		set snd to sound volume
		set sound volume to 15
		delay 1
		if unreadCount is equal to 1 then say �
			"You have a new hotmail message."
		if unreadCount is greater than 1 then say �
			"You have " & unreadCount & " new hotmail messages."
		delay 1
		set sound volume to snd
	end tell
end tell

thing is, i can’t get the script to recognize the account. if i change it to unread count of inbox it works. if i change it to unread count of a specific folder it works. if i try putting the account name in there, it doesn’t.

i’m sure this is a very simple fix, but i swear i’ve been everywhere in the last 2 hours looking for that little snippet of code to define a mail account in applescript, but to no avail. i run it in script editor, and it says 'can’t get unread count of “hotmail” '.

so go on, have your little chuckle at how the little things trip people up. but then please please PLEASE, tell me where i’ve gone wrong.