Ok so I know about the afterOpen event and I think I understand how to use it, however, I don't understand how to make it open for a specific document.
I don't want this script to run on every document that I open, I want to embed it in a documnt and then run it everytime I open that document. Is this possible?
Perhaps run the script from scripts label?
Or would I just put a script in the startup panel and then create a session script that checks the name of each document opened and then runs the script if I have a match?
As you chart put this in the startup scripts folder
Then try this line on a document and save it, then open the same file and some other others, you will notice that this code only excuted on that document:
app.activeDocument.label = "alert (\"Yes\");";
You said that if I want to script to run of specific document, I need to put that line in the document.
Where \ How do I put that code line in the document?
And, The script that you first wrote, how do I run it? just save a JSX of it in the 'startup script' folder?