5 Replies Latest reply on Jan 15, 2010 1:10 PM by try67

    using a modifier key and an if/then statement to set a print parameter

    kentgbaker

      I am trying to pass a value to a print parameter using a modifier key on windows.

       

      this.printHasMod = event.modifier;
      if(this.printHasMod)
      {
      var pDialog = 0;
             }
             else
             {
               var pDialog = 2;
             }

       

      Seems to work in the console, but does not work in my trusted function

       

      PFL_ProofPrintPortrait = app.trustedFunction(function()
      {
      app.beginPriv();
      var watermark = this.documentFileName;
      this.addWatermarkFromText({
      cText: watermark,
      nRotation: 0,
      aColor: ["CMYK", .01,.75,0,0],//Watermark in DieLine color
      nOpacity: 1,
      nStart:0,
      nEnd: 0,
      nScale: 1,
      });
      this.printHasMod = event.modifier;
      if(this.printHasMod)
      {
      var pDialog = 2;
             }
             else
             {
               var pDialog = 0;
             }
      var pp = this.getPrintParams(); 
      pp.printerName = "Duplex Portrait";
      pp.flags = pp.constants.flagValues.suppressCenter
      pp.flags = pp.constants.flagValues.suppressRotate
      pp.interactive = pDialog;// from variable

      pp.pageHandling = 3;//3=shrink to fit
      this.print(pp);
      this.closeDoc(1);
         app.endPriv();
      });

       

      Where am I going wrong?

       

      Thank you in advance