Photoshop CC 2014 Extension - CEP Event callback is triggered multiple times per single event

Trying to make my extensions listen for bunch of events and it's turning out to be a real pain in the ***.
I'm hoping there's someone here who has a bit more experience playing around with these.
I used the example code from here ( Page 43 ): http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/creativesuite/pdfs/CC14_Extension_S DK.pdf
I've modified the code just a little. I removed some unnecessary things from it. I also added a counter, to try to visualize the issue.
Every time I pasted the code here, the global variable seemed to duplicate. So, eeeeh...  the example code can be found here.
The problem is:
I close one document to trigger the event, but for some reason the callback seems to run multiple times.
Even better, it doesn't seem to be super consistent about it. Sometimes it repeats only couple of times and sometimes it repeats 160 times.
It seems like every time the extension panel is reopened, it comes up with a new number.
Currently, if I close a document, it seems to trigger the callback 15 times
Since this is screenshot, you'll have to take my word for it. I only closed a single document and the code ran 15 times.
Am I doing something wrong by any chance?
edit:
I believe I just found out the reason and a way to recreate the issue.
I've occasionally tested the extension by closing and opening the panel, which seems to have caused the issue.
It looks like every time I close and then open the panel, it... adds one more run time to the stack.
- Refreshing the panel from chrome doesn't seem to affect it.
When I restart photoshop, it resets. So after the very first opening of the panel, the event triggers the callback only once.
I forgot to mention that the host application events work just fine without these issues.
In fact, I tried to use documentAfterActivate before, but as far as I could find, there is no way to kind of filter out specific events within host application events.
For instance, I can't specify something different to happen when a new document is opened.
As very much a side note:
documentAfterActivate has its own side effect due to the way photoshop works.
It is triggered when you:
Create a new document
Open a new document
Switch to an open document
It's the "Switch to an open document" part that makes this event listener also trigger when you close a document.
Because when you close a document, photoshop switches back to the previous document and that in turn triggers the event listener when it shouldn't, I suppose.
Of course it doesn't trigger the event when you close the last document as there is no document to switch to at that point.
...but this is beyond the scope of the original question.

I was so tired last night that when I found out the cause of it, I never even thought about unregistering...
I decided to unregister it when the panel is opened instead.
This does indeed get rid of the issue.
Thanks, cbuliarca.
(function () {
  var csInterface = new CSInterface();
  function init() {
       themeManager.init();
       function registerPhotoshopEvent(in_eventId, register) {
            // Added the next line
            var register = register === "clear" ? "UnRegisterEvent" : "RegisterEvent";
            // Modified the next line
            var event = new CSEvent("com.adobe.Photoshop" + register, "APPLICATION");
            event.extensionId = csInterface.getExtensionID();
            event.appId = csInterface.getApplicationID();
            event.data = in_eventId
            csInterface.dispatchEvent(event);
       var number = 0;
       csInterface.addEventListener("PhotoshopCallback" , function(event) {
            number = number + 1;
            console.log( number );
       var closeEventid = "1131180832"
       // Added the next line
       registerPhotoshopEvent(closeEventid, "clear");
       registerPhotoshopEvent(closeEventid);
  init();

Similar Messages

  • PDDocPageLabelDidChange callback is triggered multiple times

    Hello,
    I'm working on a C++ plugin running in Acrobat 8.1.x - we register for the PDDocPageLabelDidChange callback, but whenever a labeling operation is performed (Using the Number Pages... contextual menu), the callback is triggered many times with the same parameters (to/from). Our handler performs a somewhat expensive operation, so we'd like to keep the number of iterations to a minimum, but the fact that we get what appear to be redundant callbacks, the time to process a page labeling operation becomes longer than we'd like.
    Does anybody have an explanation as to why I might see repeated callbacks with the same to/from parameters in PDDocPageLabelDidChange?
    Thanks for any guidance.

    There could be many reasons.  Does the problem still exist in Acrobat 9?
    If the values are indeed equal - then I would just check them against "the last passed values" and don't process again.

  • PopupMenuListener event on JComboBox fires multiple times per selection

              // webAddressBox IS OF TYPE javax.swing.JComboBox
               webAddressBox.addPopupMenuListener(new PopupMenuAdapter() {
                    /** @uses {@link com.ppowell.tools.ObjectTools.SimpleBrowser.Surf} */
                    final Surf surf = new Surf(webAddressBox.getSelectedItem().toString());
                     * Perform {@link #surf} processing
                     * @param evt {@link javax.swing.event.PopupMenuEvent}
                    public void popupMenuWillBecomeInvisible(PopupMenuEvent evt) {
                        System.out.println("you selected:");
                        surf.doURLProcessing();
    * PopupMenuAdapter.java
    * Created on February 16, 2007, 11:53 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package com.ppowell.tools.ObjectTools.SwingTools;
    import javax.swing.event.PopupMenuEvent;
    import javax.swing.event.PopupMenuListener;
    * Will allow for greater flexibility by implementing {@link javax.swing.event.PopupMenuListener}
    * @author Phil Powell
    * @version JDK 1.6.0
    public abstract class PopupMenuAdapter implements PopupMenuListener {
        /** Creates a new instance of PopupMenuAdapter */
        public PopupMenuAdapter() {}
         * Overrides {@link javax.swing.event.PopupMenuListener} method popupMenuCanceled
         * @param evt {@link javax.swing.event.PopupMenuEvent}
        public void popupMenuCanceled(PopupMenuEvent evt) {}
         * Overrides {@link javax.swing.event.PopupMenuListener} method popupMenuWillBecomeInvisible
         * @param evt {@link javax.swing.event.PopupMenuEvent}
        public void popupMenuWillBecomeInvisible(PopupMenuEvent evt) {}
         * Overrides {@link javax.swing.event.PopupMenuListener} method popupMenuWillBecomeVisible
         * @param evt {@link javax.swing.event.PopupMenuEvent}
        public void popupMenuWillBecomeVisible(PopupMenuEvent evt) {}
    }This code is supposed to handle a single selection from a JComboBox webAddressBox. The front-end functionality of this code blocks works just fine to the user, however, upon viewing the "behind the scenes action", I noticed that the overriden popupMenuWillBecomeInvisible() method within the anonymous inner class instance of PopupAdapter is being called 2 times upon the first time you select something from webAddressBox, 4 times the next time you select something, 8 times the next time, and so on..
    Obviously this is a tremendous waste of resources to have it call that many times exponentially - it should only call once each time you select something from webAddressBox, but I can't figure out how to get that to happen.
    What suggestions might you have to accomplish this? I already have an ActionListener that runs separately from PopupMenuAdapter that handles the user either clicking a JButton or hitting ENTER - this works just fine.
    Thanx
    Phil

    is being called 2 times upon the first time youselect something from
    webAddressBox, 4 times the next time you selectsomething, 8 times the next time, and so on..
    Then you are adding the listener to the component
    multiple times.WTO sigh.. thanx! :)

  • Linked files broken in Photoshop CC 2014 when working in the cloud across multiple computers (PC and Mac)

    I'm using the new linked file option in Photoshop CC 2014, which is great. I'm working with my files in the cloud, however because I'm working on both a PC and Mac it breaks them links every time I save the file. Is there a way around this?

    Hi, yes I'm having the same issue. The problem is that Adobe is not correctly connecting the linked files. They are using absolute paths  user/folder/folder this is just crazy and I hope they fix this.
    Changing this will fix our issue.
    I'm a professional web designer and I find the use of linked items really good. My workflow consists of creating a UI folder with different elements linked into photoshop documents saved in another folder.
    UI - elements
    Front page folder
    Second page folder
    etc.
    Moving these folders is impossible. Making my life really hard.
    Moving them to a network drive doesn't seem an option when you need to link all the files again, for each doc.
    Adobe kudos on the idea now fix the paths so this is usable across computers.
    Best
    Raven

  • Event case: number of runs of a single event ?

    Hi everybody,
    I'm working on a CCD acquire system, and I developed the control software using an event structure.
    Every event controls a setting function for my system, and placed in timeout event fucnctions to get the status of my detector.
    Data acquisition is one of the control events. Now I need perform multiple acquisition and save acquired datas to a spreadsheet file, wich must be called with the number of the iteration.
    For example for 10 acquisition, the acquisition event will run 10 times, and save 10 files named: 1.csv, 2.csv ...
    How can be built a counter wich gives the number of iterations of a single event (in example the number of runs of the "acquire data" event) ?
    Thanks in advance
    Eugenio
    LabVIEW 2011
    Solved!
    Go to Solution.

    Thanks, value signaling vas the right choice. I've wired the increment function to a shift register function of the while loop wich contains the event structure.
    Placed an indicator inside and works fine. 

  • ALV events for data_change  executing multiple times

    Hello Experts,
    I am using the event "data_changed" of cl_gui_alv_grid and its getting triggred multiple times based on
    no. of rows in my ALV grid output.
    For ex: if i have 5 rows and if i input a field in any cell in a new row, in data_changed event is triggered 2 times.
    The  LOOP AT er_data_changed->mt_mod_cells INTO ls_modified is executing 6 times as in above example
    even though is having only 1 entry.
    Can some one pls help me with this?
    Also i see the  toolbar event is often getting excuted multiples no of times making the application slow.
    Please suggest.
    Thanks
    Dan

    Dan,
    Maybe you've placed or doing something wrong, take this report as a pattern "BCALV_EDIT_03".
    Best regards,
    Alexandre

  • Photoshop cc 2014 extension menu disable

    why the extension menu is disable?

    Hi,
    I have not ben able to install a single extension in PS CC 2014. All the extensions I have or that are available in the extension browser that has replaced Exchange seem to be incompatible with PS CC 2014. Probably a few are compatible, though, but I didn't look for them. Since you cannot install any extension, the menu remains grayed out.
    When you try to install an "older" extension, you can "acquire" it but it doesn't actually installs.Sometimes you may get the following error message :
    error -411
    Compatible CC app not found.
    Solution: Install a compatible Adobe application before installing Add-ons.
    as if you had not installed Photoshop CC. So PS CC 2014 is not considered as a compatible CC app. I guess a lot of extension authors will have to rewrite their code. All the extensions I was using are now incompatible.
    Also, I found that the new extension browser and the automated installer (which goes through the CC desktop app) are rather buggy and incredibly slow. I guess we are beta testing this new "feature".
    So, if you absolutely need a particular extension, make sure it works in PS CC 2014 (probably not) and keep PS CC installed (which can also lead to some confusion since there's no CC 2014 specific version of Bridge and Extension Manager).

  • Photoshop CC 2014 Extensions Pulldown Menu Grayed Out

    I was trying to access the Kuler panel when I realized the Extensions Pulldown is grayed out. CC version is okay.

    I didn't found any hint about that in the web.
    I googled and came across this little gem buried deep in an Adobe Help article.
    http://helpx.adobe.com/photoshop/using/generate-assets-layers.html
    "Disable image asset generation for all documents
    You can disable image asset generation globally for all Photoshop documents by modifying your Preferences.
    Select Edit > Preferences > Plug-Ins.
    Deselect Enable Generator.
    Click OK."
    So I figured the reverse steps (to enable) would work in your case
    I never knew that Preference existed until you asked this question. The things you learn.

  • Exchange 2013 logging event 15004 daily 5-10 times per day causing email delay?

    Observing following event in the Servers (3 Servers having multi role with Exchange 2013 CU5)
    Log Name:      Application
    Source:        MSExchangeTransport
    Date:          15/10/2014 3:20:16 PM
    Event ID:      15004
    Task Category: ResourceManager
    Level:         Warning
    Keywords:      Classic
    User:          N/A
    Computer:      SERVER.COM
    Description:
    The resource pressure increased from Medium to High.
    The following resources are under pressure:
    Version buckets = 203 [High] [Normal=80 Medium=120 High=200]
    Physical memory load = 92% [limit is 94% to start dehydrating messages.]
    The following components are disabled due to back pressure:
    Inbound mail submission from Hub Transport servers
    Inbound mail submission from the Internet
    Mail submission from Pickup directory
    Mail submission from Replay directory
    Mail submission from Mailbox server
    Mail delivery to remote domains
    Content aggregation
    Mail resubmission from the Message Resubmission component.
    Mail resubmission from the Shadow Redundancy Component
    The following resources are in normal state:
    Queue database and disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue\mail.que") = 61% [Normal] [Normal=95% Medium=97% High=99%]
    Queue database logging disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue\") = 75% [Normal] [Normal=95% Medium=97% High=99%]
    Private bytes = 2% [Normal] [Normal=71% Medium=73% High=75%]
    Submission Queue = 0 [Normal] [Normal=2000 Medium=4000 High=10000]
    Temporary Storage disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp") = 75% [Normal] [Normal=95% Medium=97% High=99%]
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="MSExchangeTransport" />
        <EventID Qualifiers="32772">15004</EventID>
        <Level>3</Level>
        <Task>15</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-10-15T09:50:16.000000000Z" />
        <EventRecordID>36645321</EventRecordID>
        <Channel>Application</Channel>
        <Computer>SERVER.COM</Computer>
        <Security />
      </System>
      <EventData>
        <Data>Medium</Data>
        <Data>High</Data>
        <Data>
    The following resources are under pressure:
    Version buckets = 203 [High] [Normal=80 Medium=120 High=200]
    Physical memory load = 92% [limit is 94% to start dehydrating messages.]
    The following components are disabled due to back pressure:
    Inbound mail submission from Hub Transport servers
    Inbound mail submission from the Internet
    Mail submission from Pickup directory
    Mail submission from Replay directory
    Mail submission from Mailbox server
    Mail delivery to remote domains
    Content aggregation
    Mail resubmission from the Message Resubmission component.
    Mail resubmission from the Shadow Redundancy Component
    The following resources are in normal state:
    Queue database and disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue\mail.que") = 61% [Normal] [Normal=95% Medium=97% High=99%]
    Queue database logging disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue\") = 75% [Normal] [Normal=95% Medium=97% High=99%]
    Private bytes = 2% [Normal] [Normal=71% Medium=73% High=75%]
    Submission Queue = 0 [Normal] [Normal=2000 Medium=4000 High=10000]
    Temporary Storage disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp") = 75% [Normal] [Normal=95% Medium=97% High=99%]
    </Data>
      </EventData>
    </Event>
    Manju Gowda

    hi manju.. this is because of your resource utilization being very high. please check below two links to check the logs and take appropriate actions
    http://exchangeserverpro.com/exchange-transport-server-back-pressure/
    http://technet.microsoft.com/en-us/library/bb201658%28v=exchg.150%29.aspx
    Mark as useful or answered if my replies helped you solving your query.
    Thanks, Happiness Always
    Jatin
    Skype: jatider2jatin, Email: [email protected]

  • MVC �Best Practice� (handling multiple views per action/event)

    Looking for the best approach for handling multiple views for one action/event class? Background: I have a small application using a basic MVC model, one controller servlet, multiple event classes, and multiple JSP views. For performance reasons, the controller Servlet is loaded once, and each event class is an instance within it. Each event has an �eventProcess()� and an �eventForward()� method called by the controller, standard stuff.
    However, because event classes should not use instance variables, how should I communicate which view to forward to should based upon eventProcess() logic (e.g. if error, error.jsp, if success, success.sjp)? Currently, there is only one view mapped per event, and I'm having to put error handling logic in the JSP, which goes against the JSP being for just view only.
    My though was 1) A session object/variable that the eventProcess() sets, and the eventForward() reads, or 2) Have eventProcess() return a mapping key and have the conroller lookup a view page based upon that key, as opposed to 1-1 event/view mapping.
    Would like your thoughts!
    Thanks
    bRi

    Your solution seems ok to me, but maybe the Struts framework from Apache
    that implements MVC for JSP is a better solution for you:
    http://jakarta.apache.org/struts/index.html
    You should take a look at it. It has in addition some useful taglibs that makes life much easier.
    We have successfully used it in a project with about 50 pages.

  • PCIe-6321 & ConfigureChangeDetection C# - Need to "debounce" the detection - event triggered multiple times

    I am working on a C# NIDAQmx application for a hardware configuration that uses a PCIe-6321 to interface with downstream hardware.  There is a DI signal from a manual switch on the downstream hardware that I must monitor for the start/stop signal for my application's data acquisition operations.
    I was having inconsistent results using the ConfigureChangeDetection NIDAQmx functionality.  So I used the ReadDigChan_ChangeDetection sample and using Debug.WriteLine statements have verified that when the switch on the hardware is toggled, multiple ChangeDetected events are thrown before the signal settles into the actual High or Low state.
    Since I am not a hardware guru, I consulted another engineer, and was told that this is common with switches, and the signal and/or change detection needs to be "debounced". 
    Can this be done purely through additional configuration of the NIDAQmx DI task?  I saw properties for digital filtering, but don't understand their use.  I looked at the ReadDigChan_ChangeDetection_DigFilter sample, but it seems to imply that some other DI needs to be connected on the card to be used as the filter, which I don't have.  Only one DI is coming from the downstream hardware.
    Any help and/or advice will be greatly appreciated.

    I believe I have found the solution.  By searching the forums I came across a couple of posts that pointed to this article
    http://digital.ni.com/public.nsf/allkb/220083B08217CFD686257131007E5D2C?OpenDocument
    So i started playing with the corresponding properties in the C# task, and it looks like I may have to only set the following properties:
                    myTask.DIChannels[0].DigitalFilterEnable = true;
                    myTask.DIChannels[0].DigitalFilterMinimumPulseWidth = 10.240000e-6;
    According to error messages, the DigitalFilterMinimumPulseWidth for the PCIe-6321 can only be set to specific values.
    Using this in the ReadDidChan_ChangeDetection_Events sample appears to be successfully debouncing the ChangeDetection events to only 1 per physical switch toggle.
    If this is not the approach I should be using, please advise otherwise.

  • EEM - same event is triggered multiple times in a short period

    I have a applet that will monitor the routing flapping..
    event manager applet route-flag
    event routing network 10.1.2.0/24 type modify
    action .....
    I like to have a hold down timer feature of this EEM appet. Let's say the event is triggered immediately when there is one change to the 10.1.2.0/24 network, but do not trigger it again if there is another change to within 60 sec. So what I want is the action will only run once no matter how many changes within 60sec.
    How can I achive this?
    Thanks in advance.

    There isn't a native feature to do this.  You could do something using multiple applets like:
    event manager environment q "
    event manager applet route-flag
    event routing network 10.1.2.0/24 type modify
    action 010 cli command "enable"
    action 011 cli command "config t"
    action 012 cli command "event manager applet route-flag"
    action 013 cli command "event none"
    action 014 cli command "event manager applet reenable-route-flag"
    action 015 cli command "event timer countdown time 60"
    action 016 cli command "action 1.0 cli command enable"
    action 017 cli command "action 2.0 cli command $q config t$q"
    action 018 cli command "action 3.0 cli command $q event manager applet route-flag$q"
    action 019 cli command "action 4.0 cli command $q event routing network 10.1.2.0/24 type modify$q"
    action 020 cli command "action 5.0 cli command $q no event manager applet reenable-route-flag$q"
    action 021 cli command "end"

  • How can I delete events, I keep getting multiple dates for an event, have deleted and then continue to re-appear. Any suggestions?

    Birthdates entered into the calendar become multiple events. In one case it has repeated itself over 200 times. I have manually deleted these events at least 3 times and they continue to reappear. Any ideas how to correct?

    One can delete it from one's computer. In the finder go to homeuser, movies, imovie events, delete the footage.
    Then reopen iMovie and see if that helps.
    Hugh

  • Printing multiple PDF with single event at client side

    Hello,
    I have a requirement where I must print multiple different pre-populated Adobe forms (e.g. populated with a name/address) from ABAP WD. These need to be printed at a client side printer, and they don't want to see them first (that would be easy). Just print multiple forms from a single button click.
    Has anyone had this requirement? My main question is not how to pre-populate the pdfSource, but how to have the user prompted for a printer 1x and then have the forms sent straight to the local printer without displaying.
    Thanks!

    Sorry to 'hijack' this thread but i was trying to do the same thing but failed EVERYTIME!!!
    When i tried to merge just 2 multiple-paged(abt 20+ pages each) pdfs into one, it simply crashed Preview at the end of the process! Tried 'Save', 'Save all' & 'Print as PDF' but all doesn't work!
    I tried Combine PDF.app & Automator.app and the same thing happened. The combining process CRASHED the app i used...
    Help needed!

  • Help! InDesign CC 2014 crashes and loses workspace and preferences each time

    InDesign CC 2014 crashes on a daily basis (sometimes multiple times per day) causing me to lose my preferences and have to resetup  and reload my workspace... are there any fixes or is this issue even being addressed?

    It's quite likely that there is a problem with the User space on your computer. Please tell us whether you're working a Mac or Windows computer.
    Try creating a new user on your computer and launch InDesign from that user. On a Mac, that would be done in the Users & Groups System Preference.

Maybe you are looking for

  • Satellite P20-771: Blue screen error message after OS reinstalling

    I have a laptop Satellite P20-771 / Pentium 4 3.40GHz (800/HTT) / XP Home/ 17' with nVidia Geo5700 driver. As I had some problems with software, and I reinstalled everything using the provided CDs. Unfortunately the computer keeps malfunctioning givi

  • When i updated my iphone 4S to ios 6.1.2 internet stoped working, why?

    when i updated my iphone 4S to ios 6.1.2 internet stopped working, anyone know why and how i can fix it?

  • Air Print Not Working

    I have a Photosmart c410a printer setup with a wireless connection to my home network. E-Print works fine. When I try to print from my Ipad 2, IOS 5.01, the printer is recognized by the Ipad. Click to print and then nothing. Does anyone have any sugg

  • I try to  update my ipad,but still off

    Hi, I need help    I try to upadate my Ipad,but istill off

  • Material variant download

    Hi, Can we download material variant created as non stock material in R/3 . I know we can download configurable material by creating Knowledge base and then downloading SCE object. But does the material variant created in R/3 also gets downloaded.  a