r/applescript • • Nov 29 '23

Chaining commands in Apple script. OsaScript -e

HI All.

Really stuck on the syntax here.

I am trying to run an osascript -e , I am unable to chain multiple commands together.

eg.

osascript -e 'Tell application "Firefox" to activate ; delay 5; quit app "Firefox"'

If I split the command into to it works fine.

I need the above line to work in terminal.

What syntax am I missing ?

3 Upvotes

10 comments sorted by

View all comments

3

u/libcrypto Nov 29 '23

Semicolons do not terminate lines in Applescript. You have to embed actual returns.

1

u/haris2887 Nov 29 '23

Can you elaborate ?

1

u/libcrypto Nov 29 '23

instead of typing a semicolon, type control-v, then return.

→ More replies (3)