AppleScript演算子リファレンス

applescript reference

AppleScript の演算子と、結合の優先順位一覧です。

同じ意味の演算子でも数多くの表記方法が存在します( is notisn't でもいい、などなど)。本表では個人的によく使うもの以外は省略しています。

演算子

機能 演算子 備考
加算 (Addition) +
減算 (Subtraction) -
乗算 (Multiplication) *
除算 (Division) /,
÷
整数除算 (Integral division) div
剰余・余り (Remainder) mod
累乗 (Exponentiation) ^
否定 (Negation) not
連言・論理積 (Logical conjunction) and
選言・論理和 (Logical disjunction) or
等しい (Equality) =,
equals,
is equal to
等しくない (Inequality) ,
is not [equal [to]]
〜より大きい (Greater than) >,
is greater than,
comes after
〜に満たない (Less than) <,
is less than,
comes before
〜以上 (Greater than or equal to) ,
>=,
is greater than or equal to
〜以下 (Less than or equal to) ,
<=,
is less than or equal to
〜から始まる (Starts with) starts with,
begins with
〜で終わる (Ends with) ends with
含む (Containment) X contains i,
i is in X
含まない (Non-containment) X does not contain i,
i is not in X
連結 (Concatenation) &
型変換 (Coercion, Object conversion) X as TYPE
参照 (A reference to) ref,
a reference to
cf.) contents of

優先順位

  1. (, ) (グループ化)
  2. +, (正負符号)
  3. ^ (冪乗)(注: 正負符号よりも優先順位が低い)
  4. *, /, div, mod
  5. +, (加減算)
  6. &
  7. as
  8. <, , <,
  9. =,
  10. not
  11. and
  12. or

参考文献