Thanks Chris, for the prompt reply!
Running the extension on currentDoc1, then opening a second
currentDoc2 works with the same limitations described
below. So, "does your application work correctly twice during
the application session?" Yes.
Also, an update to problem 2:
Although the initial run of the extension inserts the text
correctly, if you enter a Return and attempt to repeat the
insertion on the next line, no insertion takes place, the function
fails. Otherwise, if you continue running the function on the same
line, it keeps working, regardless of whether you save the document
or not.
To revisit problem 1:
If you open the currentDoc, change it's SKU_Condition meta
tag content and save the currentDoc, the function runs as if the
change has not taken place; the dialog displays the SKU_Condition
meta tag content that was in the previous version. You have to
close the currentDoc, then reopen it, to get the function to read
the updated SKU_Condition meta tag. Note, I'm not doing the
close/reopen programatically.
I've attached the JavaScript, but I'd like to send a zip file
with the whole thing - at the risk of appearing presumptuous. A few
code snippets might not help you understand the problem, and you'll
have to be able to run the bloody thing. Can you give me an address
where I can send you this?
Thanks very much!
-Scott