2 Replies Latest reply on Dec 9, 2009 3:31 PM by Loic.Aigon

    [JS CS4] ScriptUI Cancel button inoperant during process

    Loic.Aigon Adobe Community Professional

      Hi,

       

      I made a small interface for exporting PDF. I create two buttons, one for launching the export, one to stop it.

       

      The launch button calls the exportPDF() function. This function sets two the values of the progressbar.

       

      The problem is that once the export is launched, the cancel button is no more cliackable. I would like my users to have the opportunity to stop the export process.

       

      I saw this thread but can't succeed in applying it.

      http://forums.adobe.com/message/1909296#1909296

       

      TIA Loic

       

      http://i.imagehost.org/0657/customExport.gif

       

      The script is build like this :

       

      win = new Window(...)

       

      +button export

      +button cancel

       

      +progressbar

       

      button export onClick > exportPDF();

       

      function exportPDF()

      {

             doc.export(...);

             progressbar.value=...;

      }

        • 1. Re: [JS CS4] ScriptUI Cancel button inoperant during process
          Steven.. Level 3

          It didn't look like the example had the ability to stop the script.

           

          Anyway, i'm assuming that you are calling from a modeless panel, however the panel is locked because it is completing export function.

           

          However it may be possible to create new panel with your cancel button, using the same targetengine, that can change the value of a variable checked in the createPDF loop.

           

          Steven

          http://scriptui.com

          1 person found this helpful
          • 2. Re: [JS CS4] ScriptUI Cancel button inoperant during process
            Loic.Aigon Adobe Community Professional

            Hi steven and thanks a lot for input.

            I was starting feeling desperate to get a hint on that topic.

            I tried your lead but it didn't do it. (I can assume I misused it however)

            I create the window on clicking the green button. The cancel window appears fine but I am still unable to switch the button. It's frozen like any other interactrive elements.

            That's ok, I am giving up this cancel button issue. It would be nice to get it but that's ok.

             

            For the record :

             

            main win

            green button

            onClick > Make new Window with cancel button and own interactive function

                            exportPDF(...)

             

            I wasn't any longer as the canceling window appears but still without interactivity.

             

            Thanks a lot for trying to help me anyway.

             

            Loic