• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can I see what's happening inside a script without running in debug mode?

Community Beginner ,
Jun 04, 2017 Jun 04, 2017

Copy link to clipboard

Copied

My problem is obscure. My script is over 2000 lines, and it mostly works just fine, but in special cases it messes up. So I tried running cases in debug mode and everything worked just fine, even in the special cases that didn't work when they were invoked directly from the scripts panel. So I've tried the following to try to glimpse what's going on when it's not in debug mode:

1. Put in alert messages ------ nothing happens! The alert lines are ignored, except when running in debug mode. So this does not help.

2. Put in lines to save status in the document's label object. This also works in debug mode and not when running the script by double clicking on the panel.

I thought that there might be some mode setting about turning off outside communication during execution, but I can't find any hints about that, so I guess that that's not the problem.

I also wondered whether there might be a problem with the graphics card being involved, but cannot find any information/controls about that.

Any ideas for obtaining an inside view of the variable values while the script executes from the scripts panel would be appreciated BIG TIME!!

Thanks in advance,

TOPICS
Scripting

Views

411

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jun 04, 2017 Jun 04, 2017

Copy link to clipboard

Copied

Hi

See logging with a smile in particular you might find the log.get() method useful

Unfortunately I saw today that on Windows Chrome my site is having problems scrolling down. I will have to fix that up when I get a chance, but try using a different browser if you have an issue.  

try {

    BUG

} catch (e) {

    log('!!!!!ERROR!!!!', 'e', 'SPIDER');

    var error, source;

    for (error in e) {

        if (error == 'source') {

            source = e.source.split('\n')[e.line - 1].replace(/^\s+/, '');

            log('source' + ': ' + source, 'e', 'ping');

        } else {

            log(error + ': ' + e[error], 'e', error === 'line' ? 'BOMB' : 'SPIDER');

        }

    }

}

HTH

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jun 05, 2017 Jun 05, 2017

Copy link to clipboard

Copied

Sites fixed now, the scrolling is working again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 05, 2017 Jun 05, 2017

Copy link to clipboard

Copied

LATEST

My error! I did this a few months ago, also!! I had two versions running - the one in the scripts panel and the one that I was editing. Sorry for the fuss and any time you all wasted on this. Mea culpa!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines