What are the differences between Applescripts saved as *.scpt and *.applescript?

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?


Solution 1:

.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.