Consider the following AppleScript program:
tell the application "TextEdit" to make new document
I saved this script as an Application, and ran it successfully by double-clicking the application icon.
I then simplified the script by setting the 'tell current application' popup menu to 'TextEdit' and replacing the program with the following line:
make new document
I saved the script and ran it from within Script Editor. Everything worked OK. I then ran the application by double-clicking the application icon, but now the following error message appeared:
Can't make class document
Can't make class document. (-2710)
What is the reason for this behavior?