13

It seems to me that those scripts that are saved as *.applescript are always meant to be the raw, uncompiled text while those that are saved as *.scpt can be either the raw text or the compiled program.

What advantages/disadvantages are there to using each extension?

An ancillary question: is there an analogous extension to *.applescript for the new JavaScript for Automation (JXA) language? Perhaps *.jxa?

Chauncey Garrett
  • 1,039
  • 2
  • 8
  • 19

1 Answers1

6

.scpt is in binary. .applescript is in text.

You can use Spotlight/Finder's find function to search for words in .applescript. You cannot do this with .scpt.

Since .scpt is already compiled, it's quicker to launch.

My favorite thing about .applescript is that I can write that a script that read/write onto itself, so that variables are saved for next run without creating a separate file to house the variables.

fartheraway
  • 5,066
  • 3
    "Since .scpt is already compiled, it's quicker to launch" -- really? What's it compiled in to? Byte code? Has anyone ever done a study of run time differences between compiled AppleScript and non-compiled AppleScript on modern Apple hardware? – Ian C. Apr 15 '15 at 19:09
  • @IanC. I think bytecode – randomuser5215 Mar 09 '19 at 23:13