I've figured something out, and wanted to share:
SD has a preference setting for "path to me", causing
that AppleScript command to refer to the document
file itself during debugging, so that it will mimic
its applet/droplet behavior. Unfortunately, this
has never been honored for JSOSA:
Core.me;
//
//=> "/Applications/Script Debugger 4/Script Debugger 4.app"
MacOS.pathToMe();
//
//=> new MacOS.FileSpec("/Applications/Script Debugger 4/Script
Debugger 4.app")
MacOS.appSelf()._file;
//
//=> new MacOS.FileSpec("/Applications/Script Debugger 4/Script
Debugger 4.app")
Note: "._file" replaced the "._path" getter for AEApp
instances in version 2.0.
The key is to make sure you are sending yourself
the actual "path to" AppleEvent, with a "null"
direct parameter:
Me = MacOS.appSelf();
Me.__defineGetter__( 'fspec',
function() {
var ae = new MacOS.AEDesc();
ae.build( "'null'()" );
return this.sendAE( 'ears', 'ffdr', ae );
}
);
Me.fspec;
//
//=> new MacOS.FileSpec("/Users/arthur/Desktop/blah.scpt")
OK, goodnight all.
-- Arthur