How to add a progress bar in a function that is called recursively

How to add a progress bar in a function that is called recursively

Hello

You can use ScriptUI to create progressbar in your script. Here is an example on how the progress bar can be created:

var progressRes = "dialogue."

{\

text: "Auto Collection,"------

preferredSize: [450, -1],

View1: Group\

{\

alignment: 'fill', orientation: 'column ', \

_label: StaticText {alignment: 'left', text: 'reviewing the images...} »}, \

_Progress: Progressbar {alignment: 'fill', properties: {name: 'progress'}}, \

_startAndCancel: button {text: 'Start',------}

started: false, cancelled: false,

Properties: {name: 'Cancel'} \

},\

}\

}";

var progressWindow is new window (progressRes);.

progressWindow.progressBar = progressWindow.findElement ("course").

progressWindow.cancelButton = progressWindow.findElement ('Cancel');

progressWindow.cancelButton.onClick = function()

{

If (this.started)

This.Cancelled = true;

else {}

This.Started = true;

This.Text = "Cancel";

this.window.startWork ();

}

}

Start the 'work' when you click the Start button

progressWindow.startWork = function()

{

While (this.progressBar.value< this.progressbar.maxvalue="">

! this.cancelButton.cancelled)

{

this.progressBar.value = this.progressBar.value + 1;

This.Update();

this.workFunction ();

}

progressWindow.close (this.cancelButton.cancelled? 1: 2);

}

progressWindow.workFunction = function()

{

$.sleep (500);

}

progressWindow.setMax = function (maxval)

{

progressWindow.progressBar.maxvalue = maxval;

progressWindow.progressBar.value = 0;

}

progressWindow.setText = function (label)

{

progressWindow.children [0] ['_label'] .text = label;

}

-test code

function progressTest()

{

progressWindow.setMax (8);

var result = progressWindow.show ();

Do something with result...

}

progressTest();

Thank you

-Anshul

Tags: InDesign

Similar Questions

  • How to make the progress bar display in the icon in the taskbar for WIN 7?

    How to make the progress bar display in the icon in the taskbar for WIN 7? I see Eclipse Helios can show the loading progress bar in the icon in the taskbar of WINDOWS 7 at startup.

    Is not the feature that provides JavaFX, you must write a native connection called technology such as JNI to make specific Windows API call for updating the icon in the taskbar for the application.

    Maybe you could go through the Eclipse source code to see how Eclipse and see if you can make use of the same mechanism in your application.

    More tips on how you can implement this are outside my area of expertise.

  • How to display the progress bar of the rendering in the Windows Dock?

    Is there a setting preferably under Windows that allows you to display a progress bar of the rendering on the icon in the dock for the first way AE does?

    N °

    Mylenium

  • How to hide the progress bar?

    Hello

    Is it possible to hide the progress bar in a published project? I don't want users to pause, forward, or playback of the film.

    Thank you

    NiuYa

    Just uncheck the option of the PlayBar in the skin Editor.

  • How to add a new document type to those that you can create by right-clicking on the desktop window or fodler?

    When you right-click on the desktop or the window displaying the contents of a folder and select 'New', you see a list of the types of documents you can create. How to add and delete?

    When you right-click on the desktop or the window displaying the contents of a folder and select 'New', you see a list of the types of documents you can create. How to add and delete?

    With regedit , you can see a lot of extensions of files known, for example, HKEY_CLASSES_ROOT\.txt for txtfile.   To get rid of the "new extension" option in all of the folders that you can rename the key HKCR\.txt\ShellNew to HKCR\.txt\ShellNew.disabled or similar.

    Some applications can open empty files, for example, Notepad can open a (new) empty text file.  For the purposes of C:\windows\shellnew which is indicated by an empty string (REGSZ) NullFile.
     
  • How to add a menu bar item?

    Hello:
    I discovered recently on: about, subject: config and I love these hidden pieces of info.
    But I won't forget to their topic... (im just not a technique so I don't remember stuff like that)
    ---
    Please note:
    I don't want to add to your Favorites, I forget even here I have 100s... and these are classified as things of firefox for me... so not in my favorites (my favorites are my things technical ffox v)
    ---
    similar to the PageInfo option that allows the Tools menu

    So I would like to add to my menu bar
    Tools/topic: topic
    Toolbs/About: Config
    and
    Tools/Customerise toolbars (rather than right clicking in the gray space between the icons in the toolbar)

    is this possible?
    If so, how?

    I personally put the home page to about: topic (used about: void in the past due to new windows) that this page is not intrusive and gives quick access to other pages of build-in.

    See this article on the page tab (topic: newtab):

    You can change the order of the boxes on the subject: newtab page and drag an item to another location in PIN in this position or you can remove a Web site by clicking on the close X to block this URL.

    You can drag a bookmark or history item and drop them into a slot on the topic: newtab page to pin them and have your own sites showing favorites.

    The changes manually on the subject: newtab page are stored in the chromeappsstore.sqlite file in the Firefox profile under the keys pinnedLinks and blockedLinks folder (this will change with the prefs in Firefox 20).

  • How to display a progress bar on download the file?

    Hello

    Is it possible to display a progress on the blackberry.io.filetransfer.download function bar? I don't know how to get a file size before downloading from the server? I noticed bbui.js has also a progress indicator that works ok if I knew how to calculate the total size of the file before you download and change the size of the file in bytes on the device.

    Thank you

    Finally, I found a solution for this proglem. You must use html5 XMLHttpRequest to which you can link the onprogress event and calculate procent of the loaded data. https://github.com/BlackBerry/BB10-WebWorks-samples/tree/master/fileTransfer is an example for this, but unfortunately a pure html5 file transfer does not work here because blobbuilder has been deprecated. Thr disadvantage of this approach is that all of the loaded data is kept in memory before writing to a file system and it is not suitable for large files. The device is out of memory and the operating system closes all windows/applications open in the end, it will close even the running application

  • How to add the loading bar already structured the site

    l has basically completed my site as a whole, which has a few layers and more than 400 executives who are divided into different marked sections on the main time line.

    The entire site is located in a scene.

    After that l has decided to add a bar of loading with AS3. lt type of work but made 40% so then passes to the second image. You can visit the site at 888acolyte.com

    l took the code developphp.com:

    ------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------------

    function loadProgress(my_content:ProgressEvent):void {}

    var p: Number = Math.floor ((my_content.bytesLoaded*100)/my_content.bytesTotal);
    myLoadText.text = percent + '% ';
    myLoadBar.width = % * 2;
    }
    function loadComplete(e:Event):void {}
    currentFrame + 1;
    }
    loaderInfo.addEventListener (ProgressEvent.PROGRESS, loadProgress);
    loaderInfo.addEventListener (Event.COMPLETE, loadComplete);

    ------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------------------

    l know (now) that it is strongly recommended that all of the main site will be located on the second single image. LS there any reasonable around him? lt will take me too long to copy and paste all layers and keyframes with AS3 in another video clip.

    l tried to combine all of the site in a clip to move by selecting all layers and keyframes and making the clip of a film. But somehow AS3 doesn't like it and l began to receive errors. My 2 questions are:

    1. What is the right way to combine a variety of layers with keyframes tags, AS3 in a movie clip single if she didn't was done correctly from the beginning? The end result is that framework are all the elements of the loader and frame two is the main site.

    2, l am pretty familiar with AS3 my wild guess would be that maybe can change here on the line

    "currentFrame + 1;" by replacing it with the line "currentFrame + 399;" If, in my example I have altogether 400 frames to load?

    The tutorial below can provide you with a less complicated preloading system and more reliable will not require you to play with content managers.

    http://www.gotoandlearn.com/play.php?id=85

  • How to add a preloader bar in a SWF in InDesign?

    I created a swf file in InDesign CS4 and now that I added the SWF on my site, it takes a bit to download, but the problem is that it does not show a download progress or anything.

    How can I change this in InDesign or using preloader for the swf file so as people do not leave my pages thinking there is nothing to do.

    I'm not familiar with preload or actionscript.

    Any help will be greatly appreciated.

    Thank you

    There is nothing to do. It should be added automatically.

    Bob

  • does anyone know how to add a scroll bar on a form for calculations that change the numerical value when you scroll left and right?

    Screen Shot 2015-06-02 at 09.42.43.pngAnyone know how to create scrollbars that way in the forms in Adobe Acrobat format?

    There is no such control in PDF Forms. You will need to develop yourself

    If you wish to have. I suggest just using a text field with keys + /

    instead. It will save you a lot of headaches...

    Tuesday, June 2, 2015 at 10:56, rorys9206745 [email protected]>

  • How to add a menu item in a function call

    My application requires that one screen which depends on function calls I'm adding and deleting fields according to my condition.

    for example

    Public Sub one()

    {

    -addition of horizontal field Manager

    }

    Public Sub two()

    {

    Area manager portrait \\add

    }

    now my question is - is it possible to add a menu item if I call the method "a."

    and this menu item does not appear if I call the method "two".

    If possible, pls explain me how to do...

    You can check conditions before you add menuitems in makemenu

  • How to add a second hard drive Ubuntu Server, that runs on vmware workstation 9

    Hello

    I am running vmware workstation on windows 9 8, and I installed Ubuntu 12.10 as a virtual machine on my SSD. I installed a second hard drive in the machine and use the "Add a HDD" feature on vmware workstation to add and pre-allocate space. The problem is that the drive does not appear in Ubuntu. I have checked/Media and / dev, I expected to see something like /sda *. It is a procedural step, I missed it, please help!

    Do I have to mount the drive in a special way? How can I check if it is properly attached?

    Thank you!

    What you said so far, it's like adding a second physical drive to a physical computer and the operating system cannot access until it was partitioned and formatted, and then it can be mounted.  To do the same thing in a VM!

  • How to add bookmarks to a Word Perfect document that I imported into Adobe Acrobat?

    I have to add bookmarks to a brief so that I can download it for filing in court.  It was created in Word Perfect 7 and I could use the publishing feature for import into Adobe PDF format, but I need to create a table of contents of bookmark.  I downloaded Adobe Acrobat Reader DC, but cannot see where the bookmark function is to do.

    WP of Corel uses a process of 'make PDF' non Adobe. Therefore, Acrobat PDFMakeOr does not support Word Perfect.
    With Acrobat is installed, the Adobe PDF virtual printer is available. A "file - print" WP can use this "printer" to print a PDF file as output.
    So with WP you this that Corel provides. If you need more you must post-process the PDF & which means Acrobat eh.

    Be well...

  • How to add the zero using the toString() function?

    Hello

    I looked in the manual and I can't find any reference to toString() for syntax information.  Is there a setting to use me to specify the length of the string?  And to add zeros or not?

    Here is the code that I need to add zeros:

    p laybutt.addEventListener (MouseEvent.CLICK, playSound);

    function playSound(e:Event)
    {
    SoundMixer.stopAll ();
    var num:Number = Math.ceil (Math.random () * 43);
    bigNum.text = num.toString ();
    var path: String = "Track number" + bigNum.text + ".mp3".
    trace (Path);
    var s:Sound = new Sound (new URLRequest (path));
    s.Play ();
    }

    The I am trying to open the files begins to "Track No01.

    Any ideas?

    Ron

    Try using:

    bigNum.text = num< 10="" "0"+string(num)="" :="">

    instead of bigNum.text = num.toString ();

  • You attempt to add the audio progress bar

    Hello

    I would like to add a progress bar to my Player audio flash.

    At the moment you press a button, a certain sound load and then plays.

    Here is the part of the code:

    function playSong(e:Event):void {}
    If {(my_channel)
    my_channel. Stop();
    }
    var myURL = ("mysong.mp3");
    my_sound = new Sound();
    my_sound. Load (new URLRequest (myURL));
    my_channel = my_sound.play ();
    }

    In order to build a progress bar, I wanted to know the length or duration of the sound, but I keep getting some error messages or 0s in return

    trace (my_sound.duration);

    tells me that the duration is a property not defined

    trace (my_sound.length);

    trace (my_sound.position);

    trace (my_sound.bytesTotal);

    trace (my_sound.bytesLoaded);

    all give me in return a 0

    No idea why? Why can't I access my sound properties?

    I would also be very grateful for any other suggestions on how to add a progress bar. I tried a number of Web sites, but most of the samples are AS2 code...

    Thank you

    Julie

    After loading is completed, check the length of your sound.

Maybe you are looking for

  • G62: password Bios of HP G62. System 51378837

    Hello Tried to get into the BIOS in the G62 - 51378837 system message Help, please

  • Operating system on Satellite Pro A120 freezes

    I've recently updated bios to the most recent available. After that, I rebooted and now windows freezes at the point where it seems to load driver ACPI. Then after about 10 seconds, fan gets boosted to 100% of the speed and then it will not go furthe

  • choice of print from black cartridge

    I have a HP Photosmart of 7520... When I print from photoshop it automatically uses the black photo.  Most of the time I print things to change, and I really don't want to use my black photo just the regular black... HOW to do that? Thank you

  • Broken links

    I am running Windows Vista Home Premium 32-bit Edition. Recently, when I start the laptop, I get the following boxes that appear. I click OK and they disappear, but is it possible to fix this? BookmarkDAV_client.exe - Entry Point not found iCloudServ

  • Get a pop up: "the program can't start because tsad.dll is missing on your computer.

    Original title: Miss me tsad.dll. What is c? I KEEP GETTING A POP UP THAT READS THE PROGRAM CAN'T START BECAUSE TSAD. DLL IS MISSING ON YOUR COMPUTER. TRY REINSTALLING THE PROGRAM TO FIX THIS PROBLEM!    WELL, I WOULD, BUT I DO NOT KNOW WHAT PROGRAM