Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

applescript oneliner

Tags:

applescript

Is it possible to join applescript lines into one (in ruby it can be done using ;)?

like image 871
tig Avatar asked Nov 21 '25 04:11

tig


1 Answers

Not really. The most that can be done is to take a simple if-then statement and make it into one line...

if (variable) then 
    return true
end if

...becomes...

if (variable) then return true

If you were to include the osascript command in a shell script, then multiple line scripts must delimited with -e...

osascript -e 'if (variable) then' -e 'return true' -e 'end if'

But that's about the extent of it. Applescript files aren't straightforward text files like most other programming languages (unfortunately) and we have to rely on its specialized editors for line management.

like image 196
Philip Regan Avatar answered Nov 24 '25 02:11

Philip Regan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!