我需要向许多人发送消息,让他们知道事件发生时。它总是相同的人员列表,并且总是相同的事件,所以我想编写它的脚本。
我遇到的问题是我知道我需要使用 send 命令来发送消息。该命令的格式为
tell application iChat to send "message" to _buddy_
问题是如何获取该好友。我知道如何获取所有好友的列表,并循环访问它们:
tell application "iChat"
repeat with myBuddy in buddies
end repeat
end tell
我似乎找不到的是如何获取我关心的好友,例如那些名为“Pietje Piet”和“Joe Anonymous”的好友”,然后只是向这两个联系人发送消息。
I have a need to send a message to a number of people to let them know when an event is occurring. It is always the same list of people, and always the same event, so I would like to script it.
The problem that I have is that I know that I need to use the send command to send the message. And the format of that command is
tell application iChat to send "message" to _buddy_
The problem is how to get that buddy. I know how to get the list of all buddies, and to loop over them:
tell application "iChat"
repeat with myBuddy in buddies
end repeat
end tell
What I can't seem to find is how to just get the buddies that I care about, for example those with name "Pietje Piet" and "Joe Anonymous", and then just to send messages to these two contacts.
发布评论
评论(1)
您必须以某种方式在单独的列表中获取您关心的好友列表。这是一个建议:
You'll have to aquire a list of the buddies you care about in a separate list somehow. Here's a suggestion: