• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Applescript in the terminal (fwd)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript in the terminal (fwd)


  • Subject: Re: Applescript in the terminal (fwd)
  • From: Jim Skibbie <email@hidden>
  • Date: Sat, 20 Apr 2013 16:46:58 +0000
  • Thread-topic: Applescript in the terminal (fwd)

> I lied, I just thought of one more question.  Can one compile an
> applescript from within terminal from a simple text file?

Yes. Check out the man page for osacompile (from Terminal, type: man osacompile). 

A Terminal command like:

osacompile -o ~/Desktop/my_script.app ~/Desktop/source.txt

will produce an Applescript application on the path (your desktop) named "my_script.app" from a file on the path (your desktop) named "source.txt".

My "source.txt" file contained:

display dialog "Hello World"

There are flags to make the app execute only ( -x ), stay open ( -s ), etc. The name you pass for the –o flag determines the output format, so you can pass .applescript or .scpt or .app and get different formats.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Applescript in the terminal (fwd)
  • Next by Date: Re: Applescript in the terminal (fwd)
  • Previous by thread: Re: Applescript in the terminal (fwd)
  • Next by thread: Re: Applescript in the terminal (fwd)
  • Index(es):
    • Date
    • Thread