How do I make a script both executable on its own an serve as a library for other scripts?
I'd like to script1 to include script2 so that it can use its code.
I'd also like script2 to have a main function and call it, but only if script2 is run directly from InDesign.
How do I do that?
(I'm using JavaScript.)
