Applescript Cheat Sheet

From WikiOD

Here is the cheatsheat of Applescript and basic guide on how to use Applescript

Running[edit | edit source]

osascript -e "..."
display notification "X" with title "Y"

Comments[edit | edit source]

-- This is a single line comment
# This is another single line comment
(*
This is
a multi
line comment
*)

Say[edit | edit source]

-- default voice
say "Hi I am a Mac"
-- specified voice
say "Hi I am a Mac" using "Zarvox"

Beep[edit | edit source]

-- beep once
beep
-- beep 10 times
beep 10

Delay[edit | edit source]

-- delay for 5 seconds
delay 5

Credit:rstacruz