Skip to main content
Fightergator
Inspiring
December 13, 2022
Answered

Break Out of Running Script in Framemaker

  • December 13, 2022
  • 2 replies
  • 383 views

I'm at the point where I'm about to launch my script on some unsuspecting editors. I've done as much testing as I can, but it's likely someone will run the script in a manner that wasn't intended.  Also, being somewhat of a novice, I'm sure I overlooked a necessary error trap or two.  Our editors don't have the ExtendScript Toolkit, so no way to stop a runaway script from there.  I've searched the web and this forum for any information on how to terminate (or exit) a running script from inside Framemaker.  Appreciate any suggestions. 

    This topic has been closed for replies.
    Correct answer frameexpert

    The only way I know how to do it is to just force quit FrameMaker. Of course, the best way is to make sure your code is robust enough to prevent runaways. The most likely cause are endless loop situations, but those usually show up in testing. For scripts that work on active documents and books, I will have my client test them on several documents before turning them loose on a book. Also, I never let a script save a document that it did not open, so I may tell the client to open all files in the book before running it on the book. That way, they can close the files without saving them. Of course, when in doubt, have backups done before running on production documents just in case.

    2 replies

    davidcfrye5910298
    Inspiring
    December 14, 2022

    We're no longer "unsuspecting," Gator... 

    frameexpert
    Community Expert
    frameexpertCommunity ExpertCorrect answer
    Community Expert
    December 13, 2022

    The only way I know how to do it is to just force quit FrameMaker. Of course, the best way is to make sure your code is robust enough to prevent runaways. The most likely cause are endless loop situations, but those usually show up in testing. For scripts that work on active documents and books, I will have my client test them on several documents before turning them loose on a book. Also, I never let a script save a document that it did not open, so I may tell the client to open all files in the book before running it on the book. That way, they can close the files without saving them. Of course, when in doubt, have backups done before running on production documents just in case.

    Fightergator
    Inspiring
    December 13, 2022

    Thanks Rick...I'm disappointed there isn't a way to exit a running script within Framemaker.  I can see where novice script developers will have problems in future when the customer will longer be able to use Extendscript; especially when you disable screen updating to speed up execution.   I appreciate all your tips...especially the one about not letting a script save a document it didn't open.  I'll incorporate that immediately.  Answer marked as correct.