Is it possible to use a progress bar in Photoshop?

Hi,
I'm developing an automation plug-in to Photoshop. It take long time to do the work, I therefore want to start a none modal dialog with a progress bar and a cancel button. I did not find any example of this in the SDK. Is it possible to use any of the functions in the PIProgressSuite.h for this kind of dialog?
Regards,
Mattias

I don't think you will have much luck with the progress suite. It is used for one operation that your plug-in would control. You are probably using multiple Photoshop events and want to sum them up in a progress bar. Ideally you would want a double progress bar, one for the overall progress and one for the step progress. Unfortunately, the progress suite will get reset with each process that Photoshop tries to show progress for. Your best bet is to just use an OS progress bar in your dialog. Figuring out the progress will be dificult.

Similar Messages

  • Is there a way to use a progress bar with Xerces XML Parser?

    My program is parsing very long XML files that take several minutes to parse. I am using Xerces as the parser. I would like to use a progress bar to show the progress, but I haven't found any way to get Xerces to give progress updates. Is this possible?

    Use teh SAX parser and listen to SAX events. Example:
    import java.io.*;
    import java.util.*;
    //jaxp-api.jar:
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    //sax.jar:
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.DefaultHandler;
    import mine.IOUtils;
    * Handler to read content from (large) XML sources and send events to registered XMLListeners. Use this class to read
    * big (multiple megabytes) XML files via SAX and listen to XML events to process XML elements.
    * For small (less than a megabyte) XML files, it's more convenient to use the DOM API
    * to read the XML into a DOM document and perform XPath commands. DOM is easier to handle but has
    * the drawback that the complete XML content is stored in one big DOM document object in memory.
    public final class XMLHandler extends DefaultHandler {
        /** (Reusable) XMLReader to parse an XML document. */
        private XMLReader xmlReader = null;
        /** Registered XMLEventListeners. */
        private List<XMLListener> listeners = new ArrayList<XMLListener>();
        /** Value of current element. */
        private StringBuilder elementValue = null;
        /** Stack of current element and all of its parent elements. */
        private Stack<String> elementStack = new Stack<String>();
         * Constructor.
         * @throws Exception
        public XMLHandler() throws Exception {
            super();
            // Create a JAXP SAXParserFactory and configure it
            final SAXParserFactory spf = SAXParserFactory.newInstance(); //Use the default (non-validating) parser
            spf.setValidating(true);
            // Create a JAXP SAXParser
            final SAXParser saxParser = spf.newSAXParser();
            // Get the encapsulated SAX XMLReader
            xmlReader = saxParser.getXMLReader();
            xmlReader.setContentHandler(this);
            xmlReader.setDTDHandler(this);
            xmlReader.setEntityResolver(this);
            xmlReader.setErrorHandler(this);
        }//XMLHandler()
          * Add XMLListener to receive XML events from the current XML document.
         *  If <i>listener</i> is null, no exception is thrown and no action is performed.
          * @param listener XMLListener to add.
         public void addXMLEventListener(final XMLListener listener) {
            if (listener != null) {
                listeners.add(listener);
        }//addXMLEventListener()
         * Parse current XML document. Registered XMLEventListeners will receive events during parsing.
         * @param fileName Name of file to read XML content from.
         * @throws Exception
        public void parse(final String fileName) throws Exception {
            if (fileName != null) {
                parse(IOUtils.openInputStream(fileName));
        }//readXML()
          * Parse current XML document. Registered XMLEventListeners will receive events during parsing.
         * @param inputStream InputStream to read XML content from.
          * @throws Exception
         public void parse(final InputStream inputStream) throws Exception {
            if (inputStream != null) {
                xmlReader.parse(new InputSource(inputStream));
        }//readXML()
         * Overwrite super.
         * Receive notification of the beginning of the document.
        @Override
        public void startDocument() {
            for (XMLListener l : listeners) {
                l.documentStarted();
        }//startDocument()
         * Overwrites super.
         * Receive notification of the start of an element.
        @Override
        public void startElement(final String uri, final String localName, final String qName, final Attributes atts) {
            elementStack.push(qName);
            for (XMLListener l : listeners) {
                l.elementStarted(qName, elementStack);
            elementValue = new StringBuilder(); //element value
            //element attributes:
            if (atts.getLength() > 0) {
                String attName = null;
                for (int i = 0; i < atts.getLength(); i++) {
                    attName = atts.getQName(i);
                    final String attValue = atts.getValue(i);
                    for (XMLListener l : listeners) {
                        l.attributeRead(qName, attName, attValue);
                }//next attribute
            }//else: no attributes
        }//startElement()
         * Overwrites super.
         * Receive notification of character data inside an element. This method can be called multiple times
         * from SAX, so we need to append all results of all calls to the final element value.
        @Override
        public void characters(final char ch[], final int start, final int length) {
            String s = new String(ch, start, length);
            elementValue.append(s);
        }//characters()
         * Overwrites super.
         * Receive notification of the end of an element.
        @Override
        public void endElement(final String uri, final String localName, final String qName) {
            for (XMLListener l : listeners) {
                l.elementEnded(qName, elementValue.toString());
            elementStack.pop();
        }//endElement()
         * Overwrite super.
         * Receive notification of the end of the document.
        @Override
        public void endDocument() {
            for (XMLListener l : listeners) {
                l.documentEnded();
        }//endDocument()
    }//XMLHandler

  • Is it possible to have a progress bar on a J3d-applet?

    I wonder if it is possible get a download progress bar to work on a J3d-applet. I have to do this with a JProgressBar, which is a Swing component. I have heard that it is hard to get Swing to work with Java3d. Is this the case?

    You can try to add Canvas3D in some container like JFrame, JDialog or what ever you are using and add JProgressBar to that container as well. You may use appropiate layout as well. JProgressBar cannot be a part of your 3D world. But if u want to use simple components like Label or TextFields then u could use Overlay library at j3d.org

  • How can I use a progress bar in objective c mac

    How can I use a progress bar in objective c mac? I have a code that downloads a file and I want to be able to let the progress bar increase by 1. A bit further on the code (to download the file) it needs to increase again. And so on...
    My code
    -(IBAction) downloadButtonPressed:(id)sender;{
        //get the path to the image that we're going to download
        NSURL *url = [NSURL URLWithString:@"https://www.dropbox.com/s/l6o07m48npxknt4/Cluedo.zip?dl=1"];
        //get the path to documents folder where we're going to save our image
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *DocumentsDirectory = [paths objectAtIndex:0];
        NSString *filePath = [DocumentsDirectory stringByAppendingPathComponent:@"Cluedo.zip"];
        //Download the file to memory
        NSData *data = [NSData dataWithContentsOfURL:url];
        NSError *error = nil;
        //Save it on the Documents directory
        [data writeToFile:filePath options:NSDataWritingAtomic error:&error];
        NSFileManager* fm = [NSFileManager defaultManager];
        NSString* zipPath = filePath;
        NSString* targetFolder = @"/Applications"; //this it the parent folder
        //where your zip's content
        //goes to (must exist)
        //create a new empty folder (unzipping will fail if any
        //of the payload files already exist at the target location)
        [fm createDirectoryAtPath:targetFolder withIntermediateDirectories:NO
                       attributes:nil error:NULL];
        //now create a unzip-task
        NSArray *arguments = [NSArray arrayWithObject:zipPath];
        NSTask *unzipTask = [[NSTask alloc] init];
        [unzipTask setLaunchPath:@"/usr/bin/unzip"];
        [unzipTask setCurrentDirectoryPath:targetFolder];
        [unzipTask setArguments:arguments];
        [unzipTask launch];
        //[unzipTask waitUntilExit]; //remove this to start the task concurrently

    Your code really isn't suitable for a progress bar, not a real one anyway. Your code will spend about 99.9% of its time in the method "dataWithContentsOfURL:url". That is not a method you want to use in the real world. It is only for demos or proof of concept exercises. All network operations should be asynchronous. That gives you the ability to gracefully recover when there is a failure and also to do fancy things like display a progress bar and tell the user when the download is complete.
    Once you get the asynchronous download logic working, then you can worry about the progress bar. The first thing you will need is the size of the file. Without that, all you can ever do is an indeterminate progress bar or spinner. If you have the size of the file, then you can keep track of how much of the file you have downloaded and update your progress bar with the percentage complete. Make sure to throttle it to no more than incrementing by 1% at a time. Otherwise, a large file or a file transferred in many small chunks, would waste too much time updating the progress bar for no change.

  • Seeking in videos using the progress bar

    Ever since the 2.0 update, seeking using the progress bar seems very sluggish, far from the smooth experience I had using the 1.1.4 firmware. The playback seems to snap to certain points and fast forward to the point I seek to. I updated to 2.0.1 today hoping this issue would be fixed, but not yet. Anybody else experiencing this?

    mine is even worse, after the 2.0.1, video playback is broken. There is no video!!!! but there is audio. This apply to any online video as well like youtube. any facing the same problem? How can i restore to 2.0?
    wan

  • About progress bar and Photoshop

    I have been reading a lot about how to make a progress bar in photoshop (scripting) and my conclusion is that it is not worthy. The only way to make a progress bar is by using Palette window but Photoshop does not support it. If we use a dialog window, since it is modal, it will freeze whatever your script is doing so, you cannot use it (how to track the progress of a script if the script is paused while the dialog is being shown?). Although Photoshop does not support Palette, there are two workarounds that would make it work and they are using either app.refresh() or waitForRedraw() (and undocumented function that seems to me to do exactly the same thing that app.refresh() does). But as the manual says, app.refresh() will slow down considerably your code. According to my experimentation, each time you call app-refresh(), your script will waste about 1 second (no matter how powerful your computer is). That is a lot of time! In practical terms, you would use app.refresh() only a few times so your progress bar could be refreshed only a few times during the whole duration of your script, still one second lost for each time you use it. In other words, there is no good way of making a progress bar in photoshop scripting.
    My question is: am I right? Is there a way to code a progress bar in PS that would not delay the code unreasonably?

    Since I wrote that post I've learnt that BridgeTalk is pretty sensitive - for instance to binary code: instead to let .toSource() functions that needs to go to the message, you'd better of wrapping them into a String literal.
    True, AM is lightning fast compared to DOM! But I won't use BridgeTalk for a Palette if the Palette is needed just for a progress bar. Such a Palette will stay alive while your script does all the things it's supposed to do without the need of waitForRedraw().
    In my snippets library I've found this one that might help:
    * Create a progress window
    * @param  {String}  title           = title
    * @param  {String}  message         = message (updatable)
    * @param  {Boolean} hasCancelButton = add a Cancel button (default: false)
    * @usage          w = new createProgressWindow "Title", "Message", true
    createProgressWindow = function(title, message, hasCancelButton) {
      var win;
      if (title == null) {
        title = "Work in progress";
      if (message == null) {
        message = "Please wait...";
      if (hasCancelButton == null) {
        hasCancelButton = false;
      win = new Window("palette", "" + title, undefined);
      win.bar = win.add("progressbar", {
        x: 20,
        y: 12,
        width: 300,
        height: 20
      }, 0, 100);
      win.stMessage = win.add("statictext", {
        x: 10,
        y: 36,
        width: 320,
        height: 20
      }, "" + message);
      win.stMessage.justify = 'center';
      if (hasCancelButton) {
        win.cancelButton = win.add('button', undefined, 'Cancel');
        win.cancelButton.onClick = function() {
          win.close();
          throw new Error('User canceled the pre-processing!');
      this.reset = function(message) {
        win.bar.value = 0;
        win.stMessage.text = message;
        return win.update();
      this.updateProgress = function(perc, message) {
        if (perc != null) {
          win.bar.value = perc;
        if (message != null) {
          win.stMessage.text = message;
        return win.update();
      this.close = function() {
        return win.close();
      win.center(win.parent);
      return win.show();
    Cheers,
    Davide

  • Is it possible to fit 2 progress bars within 1 (more)

    hi, I am implemented a client/server which streams music files, and plays them concurrently. I currently have a progress bar which indicates how much of the file has been downloaded.
    And I could also have a seperate progress bar indicated how much of the song has been played, but what i would really like to do, is have 1 progress bar, and have 2 actual bars moving inside it (each different colors), one indicated the download percentage (which should always be ahead) and the other indicating how much of the song has played (which will write over the download bar).
    Thus i would like to have both bars moving at the same time. I dont think this is possible, but if anyone has any ideas, I would love to hear them. Thanks!

    ok...so i got that working, and i am very grateful for your help. but i have ran into another problem:
    I want to set the two different progress bars to different colors, so you can distinguish them, so I looked at the API for fillRect says it uses the default color. so i looked in the JProgressBar to see if there is any function to change the color and there wasn't, so i tried g2g.setColor(Color.RED), and i got all these errors:
    java.lang.NoSuchFieldError: RED
    at client$JDoubleProgressBar.paintComponent(client.java:425)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintWithBuffer(Unknown Source)
    at javax.swing.JComponent._paintImmediately(Unknown Source)
    at javax.swing.JComponent.paintImmediately(Unknown Source)
    at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknow
    n Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Any ideas here?

  • How to use a progress bar?

    Hello to everyone, i am trying to put a progressbar in my application, the progress bar i use is the one that appears in the Swing Component part of JBuilder, i have the next code:
    JProgressBar progBar=new JProgressBar();
    progBar.setMinimun(10);
    when i compile the code the next error occurs:
    incorrect method declaration; the return type is missing.
    I have looked at the Jbuilder help but the code i find is the same as mine, and in other samples too.

    show some more codes....it willl surely help...i just hope the error didn't originate from the minimum() method because it was misspelled...

  • How to make use of *progress bar*?

    I have a progress bar requirement in my swings project,
    i.e on clicking a button, some task should be executed and in parallel to this
    progress should run on progress bar in the same frame and soon after this task
    gets completed the progress on progress bar should come to an end.
    How can i do this in swings?
    could any one help me out from this?

    How to use progress bar
    http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
    If you want an example scroll down to the bottom of the page and download the examples.

  • Is it possible to create a Progress Bar?

    Hi All,
    Is there any way to create a Progress Bar in a Form?
    John

    You can create your own progress bar form using Visual Basic.  Display your progress bar form with the always on top flag set with an API call.
    I've done this and I use it a lot because I have found that there is no other way to indicate to the user that a lengthy process is executing.

  • How to use a progress bar with java mail?

    Hi, i'm new here.
    I want if someone can recommend me how to show a progress bar with java mail.
    Because, i send a message but the screen freeze, and the progress bar never appear, after the send progress finish.
    Thanks

    So why would the code we post be any different than the code in the tutorial? Why do you think our code would be easier to understand? The tutorial contains explanations about the code.
    Did you download the code and execute it? Did it work? Then customize the code to suit your situation. We can't give you the code because we don't know exactly what you are attempting to do. We don't know how you have changed to demo code so that it no longer works. Its up to you to compare your code with the demo code to see what the difference is.

  • How To Use Microsoft Progress Bar import in ocx in forms6i

    I import microsoft progress bar in ocx in form6i but i dont have to initialize it
    with form or cursor..
    can any one send sample code on [email protected]
    thanxx

    show some more codes....it willl surely help...i just hope the error didn't originate from the minimum() method because it was misspelled...

  • Slow Progress Bar on Photoshop CS5

    POSTED ON 18/2/12
    Hi,
    I need help with Photoshop CS5.1 v12.1 ,
    Problem: When ever i insert a gradient or a photo it comes up with a progress bar which takes ages to load and it used to load in 1 second but now it takes ages , i have looked every where but there was no results and i really need help because i am currently editing a Wedding Movie in a different Program but i also need to make a menu for when the DVD is in the DVD Player but i went to photoshop to edit a photo but this happened and i have reinstalled it but nothing has changed. I have tried the Edit then Performance solution but that did nothing. So i need Answers As Soon As Possible!
    Thank You for your Time
    Kayy
    THIS NEEDS TO BE FIXED BY 20/2/12 or 23/2/12

    THANK YOU VERY MUCH FOR POSTING AND TRYING TO HELP
    I noticed yesterday it had something to do with the size (Length and Width) but still this is the correct answer!!!
    Thank You,
    Kayy

  • How to know the debit of dowloading in ftp to use it in the progress bar

    hello
    i have a class that download file from the server , and another class (progress bar)
    i dont know how i can get the debit of downloading with(ftp jave) to use it in the progress bar
    if so have an idea or have used the progress bar in ftp getting file please help help
    i really dont know what to do
    please hhhhhhhhhhheeeeeeellllpppp
    thanks

    i have a class that download file from the serverI take it you didn't write said class yourself. Does it have a published API you could point us at?

  • UI 6.7 How could I use Progress bar form?

    Hi all,
    some SAP Business One add-ons use a small form with a progress bar instead of using the progress bar in the status bar. Does anyone knows how to use this form?
    Bernhard

    Hi,
    I think that you have to create your own form.
    In my Addon, I create a form with FormType = ft_FixedNoTitle, add several EditTexts (9) with the property Enabled = False and Visible = False, and the name beginnig with "oEditText" + Number Sequential.
    After, when executing my code, I change the property Visible = True, to the next EditText.
    That way I have a "progress form" like used in others Addons.
    I use the following code to "progress" (after created the form)
        Private Sub WriteProgressInstall(ByVal pMsg As String, ByVal pPosition As Integer)
                Dim oForm As SAPbouiCOM.Form
                Dim oStaticText As SAPbouiCOM.StaticText
                Dim i As Integer
                Try
                    If pMsg <> String.Empty Then
                        oForm = SBO_Application.Forms.Item("frmProgressForm")
    'if we have a StaticText to show the progress message
                        oStaticText = oForm.Items.Item("oMSG").Specific
                        oStaticText.Caption = pMsg
                    End If
                    'Hide all "progress steps"
                    If pPosition = 0 Then
                        For i = 1 To 9
                            oForm.Items.Item("oEditText" + CStr(pPosition)).Visible = False
                        Next
                    End If
                    oForm.Items.Item("oEditText" + CStr(pPosition)).Visible = True
                Catch er As Exception
                    MsgBox(er.Message)
                End Try
            End Sub
    To move to next "progress step" is just call
    WriteProgressInstall("Executing Step 1..", 1)
    HTH,
    Ribeiro Santos

Maybe you are looking for

  • COMMIT_WORK in FM, SO_DOCUMENT_SEND_API1

    Hi, I use this FM to send e-mail in VA01 for a certain output type. I passed a parameter, COMMIT_WORK with an 'X'. But then when creating sales order upon saving, i got an update terminate. Studying the dump error, it is an error of COMMIT_IN_POSTING

  • BP contacts query

    Hi All Please help me with a query showing all contacts added to a BP within a specified time. This is what I have so far: SELECT T0.[CardCode], T1.CARDNAME, T0.NAME as 'Contact Person' , T0.Cellolar, T0.[updateDate],  T2.U_NAME as 'User' FROM ACPR T

  • Material Price Determination

    Dear Experts WHile doing CK11n the system genertes the message "The system could not calculate a price for material/batch 000000000000283534/ in plant 043 for valuation view 0, because none of the valuation strategies in valuation variant 001 was suc

  • Quicktime new movie recording is suddenly not seeing video

    I've been using quicktime for as long as I remember to watch TV on a corner or even my second screen while I'm doing something else. For some reason now I am just getting a black screen and no audio from my ADVC-100 even though quicktime sees it, pro

  • Upload gallery to Behance

    How do I upload a photo gallery created in Bridge CC Output Module to Behance?