メールボックスを "移動"し、アドレス帳をチェックして電子メールの送信者が既に存在するかどうかを確認し、アドレス帳グループに連絡先を追加するスクリプトを作成しようとしています。電子メールの送信者が見つからない場合、グループに追加される前に新しい連絡先が作成されます。特定の電子メールアドレスを持つ連絡先がアドレス帳に存在するかどうかはどのように判断できますか?
これまでのところ、私はパートを追加するグループのためにこれを持っている:選択したメッセージをループのための
on addPersonToGroup(person)
tell application "Address Book"
add person to group "wedding guests"
end tell
save addressbook
end addPersonToGroup
と、この:
tell application "Mail"
set selectedMessages to selection
if (count of selectedMessages) is equal to 0 then
display alert "No Messages Selected" message "Select the messages you want to add to 'wedding guests' address book group before running this script."
else
set weddingGuests to {}
repeat with eachMessage in selectedMessages
set emailAddress to extract address from sender of eachMessage
--if emailAddress is found in Address Book then
-- get the person from the Address Book
--else
-- create new person with emailAddress
--end if
--addPersonToGroup person
end repeat
end if
end tell
と「繰り返し内部コメントアウトされた部分eachMessage ... "ブロックは私がまだ理解していないものです。
AppleScriptを使用して電子メールアドレスのアドレス帳を検索するには、どのような方法がありますか?このようなタスクに適した代替スクリプト言語はMacにもありますか?