Can't Get FlattenJS to work?

Discussion of the xtools Toolkit

Moderators: Tom, Kukurykus

Colorguy

Can't Get FlattenJS to work?

Post by Colorguy »

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 »

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 »

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