When he said "pack" them into the jsx files, that's what came to mind.
I use the technique when I want to have a set of images, but don't want the user to have to deal with putting images into correct places.
A new version of my script library uses it for a widget that adds a flyout menu to any ScriptUI window, for example. I don't want the user to have to put an image in a correct place, so the script does it for them.
You can save it as a jsxbin.
The only thing to watch (that I've found so far) when saving to jsxbin are classes that get serialized with toSource().
For example, in my lib, the Hashtable and Preferences class will have instances serialized and reconstituted...
From the lib:
BobsLib.Preferences.prototype.load = function() {
var oldLevel = $.level;
$.level = 0;
if ( this.file ) {
if ( this.file.exists ) {
this.file.open( "r" );
var buf = this.file.read();
this.file.close();
var obj = eval( buf );
this.merge( obj );
} else {
$.level = oldLevel;
throw "Preferences Not Yet Saved";
}
} else {
$.level = oldLevel;
throw "Preferences File Not Set";
}
$.level = oldLevel;
this.wasLoaded = true;
}
BobsLib.Preferences.prototype.save = function() {
if ( this.file ) {
this.file.parent.verify();
this.file.open( "w" );
this.file.write( this.toSource() );
this.file.close();
} else {
throw "Preferences File Not Set";
}
}
After a Preferences instance is saved, it can't be loaded because the eval() fails. Looks like the constructor isn't available as text causes the problem.
Bob