0 Replies Latest reply on Jun 10, 2013 2:03 AM by Beliakov

    Why function doesn't accept variable? [CS6-jsx]

    Beliakov Level 1

      I make preflight. And have two profiles: 'out' and 'BlockPS'.

      After checking with profile 'out', i check with profile 'BlockPS'.

      And send name of Preflight profile to function.

       

      var mGood = null;
      var mProfil = 'BlockPS';
      if (mPreflight(mGood, mProfil)==false) {
          exit();
          }
      
      function mPreflight(mGood, mProfil) {
          mGood = true
      app.preflightOptions.preflightOff = false;
      aD.preflightOptions.preflightWorkingProfile= mProfil;
      }
      var profile = app.preflightProfiles.item(mProfil);
      var process = app.preflightProcesses.add(aD, profile);
      ...
      }
      

      But when checking name of used profile ($.writeln(profile.name)) i see previous profile with name 'out'. That means, function didn't accept data.

      Even more: i see, that even after manual assigning new name of profile in code old name is kept in preflight panel. And even more (i manually chose profile in Preflight panel as 'BlockPS'):

      and before executing line

      aD.preflightOptions.preflightWorkingProfile= "BlockPS";
      

      profile is still BlockPS, but after executin this line, profile appears as 'Out'.

      Is it miracle?

       

      ADDON

      if i use function in the same file - all is OK.

      This is happening only if i try this in library file (mLib.jsx).