Can't Get FlattenJS to work?

Discussion of the xtools Toolkit

Moderators:xbytor, DavideBarranca, Paul MR

Post Reply
Colorguy
Can't Get FlattenJS to work?

Post by Colorguy » Fri May 27, 2011 7:57 pm

I have a script that makes about 15 calls to another included script:
After running FlattenJS as specified, I'm left with a copy of the original file with no changes. The includes scripts are not written to it?

Code: Select all  // Scripts
  function step26(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var estr = '//@include "/c/Program%20Files/PSScripts1/Run1.jsx";\r\n';
    eval(estr);
  };

xbytor

Can't Get FlattenJS to work?

Post by xbytor » Fri May 27, 2011 8:35 pm

FlattenJS only works with files that use this mechanism.
Code: Select all//@include "filename.jsx"

Doing an eval like you do will not be captured.

You need to change the code to look like this:
Code: Select all  function step26(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
//@include "/c/Program%20Files/PSScripts1/Run1.jsx"
  };

That should probably work for you.

Colorguy

Can't Get FlattenJS to work?

Post by Colorguy » Sat May 28, 2011 12:14 am

Thanks X. I should have realized that. I'll just do a find and replace all and do the fix.

Post Reply