「複数の条件がある場合はapplescript」をグーグルで検索してこの投稿に出くわしましたが、ここで期待していたコードスニペットに出くわしませんでした(情報提供のみを目的として):
複数の条件を再帰的にスキャンすることもできます。次の例は次のとおりです。—送信者の電子メールアドレスに(Arg 1.1)何か(Arg 2.1.1および2.1.2)が含まれているかどうかを調べて、スクリプトをすぐに停止し、「通知」=> true(Arg 3.1)します。—フォルダー/メールボックス(Arg 1.2)が "2012"(Arg 2.2.1)で始まるが、フォルダー2012-ABまたはC(Arg 2.2.2)ではないかどうかを確認する3つのフォルダのうち停止して何もしません=> false(Arg3.2)。
if _mc({"\"" & theSender & " \" contains", "\"" & (name of theFolder) & "\""}, {{"\"@me.com\"", "\"Tim\""}, {"starts with \"2012\"", "is not in {\"2012-A\", \"2012-B\", \"2012-C\"}"}}, {true, false}) then
return "NOTIFY "
else
return "DO NOTHING "
end if
-シェルスクリプトによる複数の条件の比較
on _mc(_args, _crits, _r)
set i to 0
repeat with _arg in _args
set i to i + 1
repeat with _crit in (item i of _crits)
if (item i of _r) as text is equal to (do shell script "osascript -e '" & (_arg & " " & _crit) & "'") then
return (item i of _r)
end if
end repeat
end repeat
return not (item i of _r)
end _mc
https://developer.apple.com/library/mac/#documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_about_handlers.html#//apple_ref/doc/uid/TP40000983-CH206-SW3