applescript to send iChat

I have set up hazel on our server so that is it monitoring a network share, but the problem with this is notifying people when rules are matched. So I've set a rule to send a iChat to certain people ( I'd prefer it to send the message to the person who placed the file but I see no way to do that)
I'd like to improve this script so that it included part of the file path in the message, but not the whole path, just the 3 enclosing folders, not sure if that is possible?
I'd like to improve this script so that it included part of the file path in the message, but not the whole path, just the 3 enclosing folders, not sure if that is possible?
- Code: Select all
set peopleICareAbout to {"Rob Hardy", "Davey Podmore", "David Brudnell", "Amanda Marwood"}
tell application "Image Events"
set the props_rec to the properties of theFile
set fileName to the (name of props_rec)
end tell
tell application "Messages"
repeat with myBuddy in buddies
--get properties of myBuddy
if full name of myBuddy is in peopleICareAbout then
send fileName & " has been placed in RAW GRAPHICS" & return & "Check it is Vector and move to the correct graphics folder" to myBuddy
end if
end repeat
end tell