Skip to main content
Known Participant
August 13, 2008
Question

[JS] InDesign Crashes Randomly

  • August 13, 2008
  • 13 replies
  • 1340 views
I have a script (which is fairly complex, calling shared script files, etc.) and I have a random crashing problem in CS2. CS3 never crashes, but CS2 randomly does. Since it is a random crash I am having a hard time figuring out how to solve the problem. I don't know if I am doing something InDesign doesn't like, if I am pushing InDesign to hard with the amount of stuff it is doing (should be). I usually get error messages when I have scripted something wrong, but not when it crashes. And sometimes the script finishes without errors or crashes and it's worked perfect. So if it can work sometimes I am having a hard time figuring out the source of the crash. Any ideas of how I can figure this out without error dialogs and without a set time that it crashes? I have random issues like this! (And remember that CS3 I have never seen crash on it, just CS2.)

I know this is a weird one and sorry I can't be more specific. Thanks for any help.
Dan
This topic has been closed for replies.

13 replies

Known Participant
August 13, 2008
Thanks, I'll check out your Log class Bob to see if that can track down the error.

Harbs mentioned about local variables. I always declare a variable like this:
myVariable = "something"


I never use the word var in front of a variable. I make sure I use unique names. To make the variables local do I have to put var in front of it? Would that really make a difference if I use unique names all the time? I have never seen any difference in putting var in front of variable names yet, so I have never bothered.

Thanks again.
August 13, 2008
Daniel,

I doubt you're pushing ID too hard. I've shoved ID so hard (CS2 and 3) that I'm amazed something didn't go massively wrong.

The first thing you have to figure out is exactly what call is causing the crash.

Alerts are a pain in the butt. I would recommend creating a log file.

I have a Log class that works pretty well that I've just updated on www.creativescripting.net. It'll be in BobsScriptLibrary.

Place a log call at the top of every function, and run it until it breaks. That'll give you the function causing the problem. From there, place log calls through out the function, crash it, and repeat until you find the offending line.

Once the offending line is known, the answer may be obvious to you or someone on this forum.

Good Luck!

Bob
Harbs.
Legend
August 13, 2008
Hi Daniel,

That's a tough one!

One issue which might be worth looking into, is variable name conflicts.
I've had issues with crashes when certain global variables were
redefined. I doubt my specific issue is connected to yours, but try and
make sure that all your variables are local. You can alsotry to track
down were things go wrong by using alerts or script logs.


Harbs