Reply to: Common MacroOctober 11, 2013 at 8:03 pm
Sorry, I thought the dialog for “Add Existing Item” allowed you to reference an existing file and leave it in place. That feature has either been removed or I remembered incorrectly. If you import files from an existing project I believe that option is actually available.
Let's work on the second option though, since that is surefire. Yes, you will need to have code that imports the file. There is no way around that. If you set it up correctly with some planning then that code should never need to change. Each project needs its own MCR file in order to run scripts so you already have to have some script in each document-level project. There is no way around that. Just add your separate .JS file to one project or don't add it to any project. When you deploy your MCR files to an XMetaL Author installation copy the .JS file at the same time. You could also automate that if you want to using the “Post Build” functionality in the Visual Studio “Property Pages” for your project.