Helper file loads as .ascript but not .scpt

I used to have a bunch of files that included this line:

property Helpers : load script POSIX file "helpers.scpt"

Basically I could then use things like “tell Helpers” later on and access this script with common functions that I use.

It used to work when I had a file named “something.ascript” that called “helpers.scpt” (it is in the same folder) like above… BUT by simply changing the file to “something.scpt” instead (more accessible by script editor) it won’t compile.

It says “Can’t make file “:helpers.scpt” into type file.”

Any idea why?

You can’t use relative paths like that.

If you’re running Mavericks or later, consider using script libraries instead. Then AppleScript can search for the file in the designated Script Libraries folders, including one in the script’s bundle if it’s an applet or script bundle. Then the syntax becomes:

use helper : script "helpers.scpt"
tell helper

I get “Can’t get script “helpers.scpt””

I get that error every time after trying to put my helpers.scpt file in each of these locations:

  1. the same path as the script being executed (which you said wouldn’t work)
    /Library/Scripts
    ~/Library/Scripts

Did I misunderstand something?

Yes – the name of the folder needs to be: Script Libraries