Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I call a apple script from shell script?

how can I call apple script from shell script.

I have a shell script which I use in Run Script phase of my xcode project. Before this shell script is executed and I want to call another apple script?

like image 908
PaviP Avatar asked Jan 01 '26 20:01

PaviP


1 Answers

You can use the osascript utility.

Here's the intro to the utility, using man osascript:

OSASCRIPT(1)              BSD General Commands Manual             OSASCRIPT(1)

NAME
   osascript -- execute AppleScripts and other OSA language scripts

SYNOPSIS
   osascript [-l language] [-s flags] [-e statement | programfile] [argument ...]

DESCRIPTION
   osascript executes the given script.  It was designed for use with AppleScript,
   but will work with any Open Scripting Architecture (OSA) language. 
   ...

You may also be interested in the osacompile utility.

like image 84
justin Avatar answered Jan 03 '26 14:01

justin



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!