Mouse events causing script to skip

Hi all,
The code itself is roughly 500 lines long so I'll only post snippets if needed, but here is the problem I am experiencing. I have a cocoa-applescript application for compressing files with ffmpeg and then rsycning over ssh to our servers at work. I use expect scripts as background processes (expect_command &> /tmp/output.txt &) to read and display progress
Here is the problem I am experiencing. When the application is run (both inside and outside of Xcode, as well as on other machines) every time the mouse moves or clicks it causes the applescript to skip around. So for instance, if it is in the middle of compression and the mouse is moved it'll exit the repeat loop that is displaying progress and move to uploading. If I don't touch anything all works just fine. There is literally nothing in the code (save for GUI buttons that initiate sender routines) that has to do with mouse events, in fact I didn't even think it was possible to intercept mouse events with applescript.
I am just looking for anything that could shed some light on this situation. Either ideas of what might be causing it (I've tried everything I can think of, i.e cleaning, rebuilding, testing on multiple platforms), or workarounds. Like I'd even be happy if I can just get it to ignore the mouse during my repeat loops for progress.
First time poster, but long time reader so sorry if I am breaking any forum rules. I am happy to provide any info that can help diagnose this very very strange bug.

Hard to say without seeing some code, but you might try adding some log statements around the code where it is moving on to the next step to see why the previous step is exiting. 
In general you should avoid using any significant AppleScript repeat loops, since events will get backed up in the queue until the system is given some time to process them.  The timing of the actual problem may also be getting distorted by any backed up events, since they would be delayed while the script is in the loops.

Similar Messages

  • Firefox mouse event not behaving the same on PC and Mac computers

    I use the FCKEditor and having a very strange problem. When I click on the FCKEditor's editing area, the keyboard gets disabled untill I click the mouse somewhere outside of the editing window. The problem only happen on Firefox (3.6.10) on Mac computer (Snowleopard 10.6.4). Doing exactly the same steps on PC works without any problem.
    What I want to know:
    - Is it possible that the Firefox on Mac is different than the PC in handling mouse events? Or some other areas?

    Sounds more that Firefox is treating that editor area as read-only.
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • ITunes causing music to skip

    Hello everyone. Lately, after using iTunes for a few hours the music starts skipping making the computer run choppy. It also skips the mouse and causes programs to timeout. I'm running the latest version of iTunes. I have no spyware, viruses or hijacks. Any idea on what could be the problem?
    I have also defragmented the hard drive and updated the audio driver.

    You may want to check your soundcard output in QuickTime. See this post for directions on the process: http://discussions.apple.com/message.jspa;jsessionid=aXxb7IZbMDPmI_4E?messageID=814726&ft=y&#814726
    And this Article: iTunes and QuickTime for Windows: Songs and other audio don't play correctly
    And before you do any of the above, make sure that you have all the recent Windows Updates from windowsupdate.com. Make sure you have the latest drivers for your particular sound card, and make sure you have the latest DirectX installed. Any of these could also cause this problem without QuickTime being the culprit.

  • Mouse event error

    I have this error message on a button that I am trying to
    apply this script to:
    on(release){
    gotoAndPlay("still1");
    **Error** Scene=Scene 1, layer=button1, frame=35:Line 1:
    Mouse events are permitted only for button instances
    on(release){
    Total ActionScript Errors: 1 Reported Errors: 1
    It is a button, it is on it's own layer, and nothing else is
    happening on that layer.
    So what is happening here?
    Kevin

    kevin raleigh wrote:
    > I have this error message on a button that I am trying
    to apply this script to:
    >
    > on(release){
    > gotoAndPlay("still1");
    > }
    > **Error** Scene=Scene 1, layer=button1, frame=35:Line 1:
    Mouse events are
    > permitted only for button instances
    > on(release){
    The action is applied to frame not button, make sure you
    select the right thing
    before applying your action, sometimes flash loses focus and
    accidentally you
    can select frame instead. The error actually clearly state
    that:
    You asing button action to Scene 1, layer named 'button' and
    frame 35.
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Origin of mouse events

    Hi, just new to the forum and I hope you can help me out with the following question.
    When a class (MyFrame) extends JFrame which has buttons on it, what class will tell JFrame that there was a click event on the button.
    As far as I know, when the MyFrame implements the actionlistener interface the method actionPerformed will be called. But who executes that function?
    The same goes for mouse events, how is MyFrame which implements a MouseListener interface, getting the function call to mouseClicked (for example).
    I hope I formulated the questions well, cause i'm not a native english speaker(writer).
    Please help me understand the origin of those calls.
    Thanks,
    Starik

    Okay, your MyFrame object doesn't have to implement MouseListener and in fact it's not usually a good idea. It could be any object!
    But if you have a MyFrame object that implements MouseListener and has all the appropriate methods, then to make the button notify it, you have to add the MyFrame as a MouseListener to the JButton.
    JButton b = new JButton("Hello");
    MyFrame frame = new MyFrame();
    b.addMouseListener(frame);

  • How to bind mouse event in 3D

    I want to bind mouse click event of a simple button with z>0,
    but the area can cause the event of the button is wrong. Much small than the shape I can see in player.
    I don't know what should be noticed when bind mouse event in 3d?
    looking forward your answer, thanks a lot.
    in document class, i wrote:
    this.x = 0;
    this.y = 0;
    this.z = 10;
    this.btnPrev.addEventListener(MouseEvent.CLICK, this.onPrevClickH);
    //btnPrev is added by flash IDE

    this.x = 0;
    this.y = 0;
    this.z = 10;
    this.btnPrev.addEventListener(MouseEvent.CLICK, this.onPrevClickH);
    //btnPrev is added by flash IDE
    You are changing the z position of the Main Timeline object... I think you want the button to change z pos, not the whole timeline. If you just change the z of the button the hit area will work as expected. So, the code above would be:
    btnPrev.x = 0;
    btnPrev.y = 0;
    btnPrev.z = 10;
    btnPrev.addEventListener(MouseEvent.CLICK, onPrevClickH);
    //btnPrev is added by flash IDE

  • Allowing Mouse Events to "Fall Through" When Window Activated

    I'm implementing a "tool pallette" in my application (much like tools in an application like Photoshop) and I want the user to be able to immediately click on options on this pallete without having to make the window active. Since Swing doesn't have an explicit "Pallete" window that would give this to me for free, I'm assuming I need to subclass JDialog to make this happen.
    Even if window activation still must happen, it's crucial that the user only needs to click once to press the button on an inactive window.
    I know I can detect WindowEvents like WINDOW_ACTIVATED by simply adding my own window listener, but I don't know how I'd go about having mouse events "fall through" the window listeners and cause the appropriate action on the underlying component. It's almost as if I need to tell the window itself to listen for nothing.
    I thought glass planes may be the answer, but that doesn't seem to be what's preventing the intial click in an inactive window from falling through to the underlying component.
    Any thoughts, comments, or experiences regarding this are greatly appreciated!

    Such a simple solution to such a perplexing problem. You are absolutely right. It turns out I was experience a bug in my particular L&F. Trying this with the Windows L&F proves that simply changing from JWindow to a non-modal JDialog works. Now I'll have to go about getting the bug fixed in the MacOSX (Aqua) L&F so I have equivalent behavior across all our supported platforms.
    Thanks for the quick response.

  • Mouse Events "Falling Through" During Window Activation

    I'm implementing a "tool pallette" in my application (much like tools in an application like Photoshop) and I want the user to be able to immediately click on options on this pallete without having to make the window active. Since Swing doesn't have an explicit "Pallete" window that would give this to me for free, I'm assuming I need to subclass JDialog to make this happen.
    Even if window activation still must happen, it's crucial that the user only needs to click once to press the button on an inactive window.
    I know I can detect WindowEvents like WINDOW_ACTIVATED by simply adding my own window listener, but I don't know how I'd go about having mouse events "fall through" the window listeners and cause the appropriate action on the underlying component. It's almost as if I need to tell the window itself to listen for nothing.
    I thought glass planes may be the answer, but that doesn't seem to be what's preventing the intial click in an inactive window from falling through to the underlying component.
    Any thoughts, comments, or experiences regarding this are greatly appreciated!

    The solution to this problem was posted in the Swing forum. Turns out to be a simple difference of JWindow and JDialog, but a difference I wasn't seeing under all L&Fs (i.e., Windows L&F handles JDialog properly, MacOSX (Aqua) L&F seems to treat it like any other window... I've filed a bug with them).

  • Iocane: poison the rodent (simulate X11 mouse events from keyboard)

    Iocane: the colorless, oderless, tasteless poision that will rid your system of its rodent infestation.  Though no promises about its effectiveness against Rodents Of Unusual Size.
    Iocane simulates mouse events from the keyboard.  Iocane can be passed a few parameters which - ideally - could each have a key binding in your favorite window manager.
    If iocane is called with no parameters it starts in interactive mode (which currently lacks documentation ... hey, I just wrote this this morning).  In interactive mode the directional arrows or h/j/k/l keys move the mouse cursor.  The number keys simulate button presses (1 = left button, 2 = middle, 3 = right).  The page up and page down keys simulate mouse wheel activation.  "q" quits from interactive mode returning any grabbed keys to their normal behavior.  Key bindings are all controlled from a simple rc file.
    Iocane can also be passed a series of commands on the command line or the filename for a script file with a list of iocane commands.  Iocane can also read command from its standard input.
    Iocane is conceptually similar to some functions of xdotool, but iocane should work under any window manager (or no wm at all), is much smaller, and the interactive mode allows for a sequence of many actions without the program having to start up and close down many times in rapid succession.
    Please report bugs or feature requests here.  Iocane is currently 127 lines of C, and it will remain small; in other words, features will only be added if the can be added without substantially increasing resource use.
    EDIT: Version 0.2 is now in the AUR
    Last edited by Trilby (2012-11-03 02:23:15)

    Any arbitrary number of buttons should be easy enough to simulate - provided the Xserver actually responds to events with that button number.  An update I'll push to github tomorrow will include a few changes, including buttons 1-9, but if there is need/desire I could increase that.  Sticking to 1-9 allows for the computationally cheaper hack of converting a string to a number by simple substracting 48 from the value of the first character; numbers greater than 9 would require the use of atoi() or some funky conditionals.  In the grand scheme of things this is fairly trivial, but unless there is a real reason to use more than 9 mouse buttons I'd prefer to keep the lighter code.
    Passing a window name and getting it's coordinates is possible but after considering it I've decided it wouldn't fit well in iocane.  The reason being that to do a half-arsed job of it would be pretty easy.  To do it properly, however, it would take quite a bit of scanning through recursive calls to XQueryTree, polling atoms/wmhints, matching strings, checking for subwindows in the case of reparenting window managers, and a bunch of other nonsense ... all to get two coordinates.
    However iocane will play nicely with any tool that will provide those coordinates from a given window name, so I can imagine and invocation such as the following to move the mouse 10 pixels right and down from the top left of a window - lets call it FlamingSquirrel - and simulate a click there:
    iocane $(cool_app FlamingSquirrel) : move 10 10 : button 1
    Currently that could only be done from a command line invocation, not from a script or interactive session, as it requires shell processing for the command substitution.  I can add support for this type of invocation in scripts and interactive mode as well.  Then all you need to do is find (or write) a program that will give coordinates for a window given a title/name.  I suspect such a program probably exists out there, or if you are comfortable with C, I could give you the starting framework for it as I made something that would have much code in common for another task on these forums (it's in jumpstart.c in the "misc" repo on my github).
    In fact, you could use the following
    xdotool mousemove --window FlamingSquirrel 0 0 && iocane offset 10 10 : button 1
    Though if you are using xdotool anyways, I'm not sure if iocane would serve much of a purpose, unless you just prefer iocane's syntax.
    Last edited by Trilby (2012-11-01 00:21:14)

  • Mouse events listener

    I'm having trouble listening for mouse events in Bridge CS6.
    This example script works well in Photoshop and Toolkit, but not in Bridge:
    var w =new Window ("dialog");
    var b = w.add ("button", undefined, "Qwerty");
    b.addEventListener("click", function (k){whatsup (k)});
    function whatsup (p)
      if(p.button == 2){ $.writeln ("Right-button clicked.") }
      if(p.shiftKey){ $.writeln ("Shift key pressed.") }
      $.writeln ("X: "+ p.clientX);
      $.writeln ("Y: "+ p.clientY);
    w.show ();
    Other event types like resize or focus work well.
    The event types that seem to be broken are: mousedown, mouseup, mouseover, mouseout, click
    Is there a work-around to this problem?

    Only the video edition team is using CC.
    We tried 2 times, on May and July to install 1 PC with CC and the apps (Photoshop and Bridge included) crashed several times.
    CS6 still is more stable.
    For my surprise, 90% of the code we have developed still works on photoshop/Bridge and now we are installing our 'private' company cloud network so my team will be editing also the photos from US on real time.
    Recently I have had success in discovering simple tricks regarding Bridge that anyone needs or uses, but crucial to hard workflows like the one we have.
    In that sense, may be next season we will be able to upgrade to cloud CC
    We'll see…

  • When both plug-in objects and jQuery mouse events are present, Firefox re-starts the plug-in object (eg Flash movie) after a jQuery mouse event occurs. This doesn't happen in any other browser. How can I get around this?

    Please check http://www.syus.com for an example. There is a Flash movie underneath the main navigation. The main navigation has a jQuery mouse event, and when you mouse over a button in the main navigation, the Flash movie re-starts. I can confirm that this happens not only on Flash swf files, but on standard <object> YouTube embeds.

    Ok, I promise this is my last post without your help. I did some more troubleshooting and it only seems to happen when jQuery appends elements to the body that were previously invisible. In other words, I can simply change the css in jQuery from using element.css('display','inline'), but if I try to use something like slideDown or other jQuery tooltip functions that append and/or remove elements or style definitions it causes the "object restart" bug.
    It is impossible for any developer to eliminate this bug without changing the actual source of jQuery, which I can't do. My only other option is not to use sophisticated show/hide jQuery elements like drop-down menus and tooltips on the same page as an embedded object, but I don't want to do this since Safari, Chrome and even IE (dear God) users won't have a problem with this. I think this is a major major bug that should be fixed in Firefox 4 as more and more sites will be looking to use the latest jQuery plugins.

  • Mouse events don't work on a button from a panel ran in a DLL

    Hi.
    I have a DLL that loads a panel.
    Since it's a DLL I can't do the RunUserInterface() function, because the DLL would be stuck waiting for the panel events.
    I only do the LoadPanel().
    When I click with the mouse on one of the buttons, the pushing down event (simulating the button being pressed) doesn't happen and the callback doesn't run.
    But if I press the tab button until the focus reaches the button and press Enter, the callback of the button is executed.
    An even more interesting aspect is that this happens when I call the DLL on TestStand, but on an application of mine that calls the DLL just for debug everything works fine.
    How can I enable the mouse events?
    Thanks for your help.
    Daniel Coelho
    VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
    Controlar - Electronica Industrial e Sistemas, Lda
    Solved!
    Go to Solution.

    Hello Daniel,
    I got surprised when I read your post, because I am experiencing something almost the same as you do.
    I have a DLL (generated by an .fp instrument driver I wrote) which performs continious TCP communication with the UUT.
    It starts 2 threads, each for reading from one of the 2 different IPs the UUT has.
    Another DLL tests this UUT (with the help of the communication DLL above) by exporting functions to be called by TestStand steps.
    If the second DLL wants to display a CVI panel in order to wait for the user response or displays a popup (MessagePopup, ConfirmPopup, etc), user cannot press the buttons.
    Actually, there is a point your program and mine differ. I call RunUserInterface and the button's callbacks call QuitUserInterface, so the execution continues after a button is pressed. The problem is buttons cannot be pressed. I also tried looping on GetUserEvent  but it did not solve the problem.
    There are 2 findings:
    1. I had a small exe to test my instrument driver DLL and the popups in it worked pretty well (this coincides with Daniel's findings).
    2. We workedaround the problem by shutting down the communication threads in the instrument driver DLL before the popup appears and restrating them afterwards. Although they are separate threads in another DLL, they were somehow blocking user events on another DLL running.
    S. Eren BALCI
    www.aselsan.com.tr

  • Mouse Events are slow

    Hello everyone,
    I'm currently working on an standard as3 (1024x768) app that
    is running inside a chromeless Air window to take advantage of the
    transparency.
    All my tests where done using windows XP professional and AIR
    1.0 (the same problem existed in beta3).
    The issue I'm having is related with Mouse Events. Somehow
    the events take a lot of time to reach the swf file when the user
    clicks inside the transparent window.
    It's natural that the app runs slower inside a transparent
    window (the framerate drops) but I wasn't expecting the clicks to
    suffer from such delay (it takes sometimes 2-5sec).
    The app is very CPU intensive and the transparencies make it
    worse. Something inside the AIR framework is not dispatching the
    events properly.
    I say this because I tried using the virtualMouse class from
    senocular together with a socket to simulate the mouse clicks and
    that did the trick.
    In conclusion:
    Something in the AIR framework for windows XP is messing up
    the dispatch of the Mouse events when the app is under heavy cpu
    usage inside a chromeless window. I click on the window and it
    takes 1-2sec to receive the click event.
    However when I dispatch the MouseEvent.CLICK myself using
    the virtual mouse class the application immediately receives the
    event.
    I know this is a strange bug and not many people will have
    this problem, but I would like to know from someone with knowledge
    of the runtime why this could be happening.
    Thank you
    Tiago Bilou

    Hello everyone,
    I'm currently working on an standard as3 (1024x768) app that
    is running inside a chromeless Air window to take advantage of the
    transparency.
    All my tests where done using windows XP professional and AIR
    1.0 (the same problem existed in beta3).
    The issue I'm having is related with Mouse Events. Somehow
    the events take a lot of time to reach the swf file when the user
    clicks inside the transparent window.
    It's natural that the app runs slower inside a transparent
    window (the framerate drops) but I wasn't expecting the clicks to
    suffer from such delay (it takes sometimes 2-5sec).
    The app is very CPU intensive and the transparencies make it
    worse. Something inside the AIR framework is not dispatching the
    events properly.
    I say this because I tried using the virtualMouse class from
    senocular together with a socket to simulate the mouse clicks and
    that did the trick.
    In conclusion:
    Something in the AIR framework for windows XP is messing up
    the dispatch of the Mouse events when the app is under heavy cpu
    usage inside a chromeless window. I click on the window and it
    takes 1-2sec to receive the click event.
    However when I dispatch the MouseEvent.CLICK myself using
    the virtual mouse class the application immediately receives the
    event.
    I know this is a strange bug and not many people will have
    this problem, but I would like to know from someone with knowledge
    of the runtime why this could be happening.
    Thank you
    Tiago Bilou

  • How to get the name of correlation item in OM through event processing scripts?

    I am trying to write a groovy script in OM event processing scripts, I want that script to read the event correlation and set custom attributes accordingly. I am unable to read the correlation item. Please guide me how to get it? What method should I use to get the correlation item? I am using OPR library.

    Hi there,
    the name property would be the correct attribute to get the subform name, just by looking at the code it doesn't seem like it's doing the right thing
    I am assuming that you send Main in the function countChk() which would look something like this
    countChk(Main);
    And you probably want to make sure you are entering the right subform so you need to keep that loop at the end of the function
    but if you want to get through all the checkboxes inside that subform you must do a loop through that node to find each checkbox
    I am assuming that the function would probably look something like this
    function countChk(vNode) {//Starts vNode with Main
         for (var i = 0; i < vNode.nodes.length; i++) {
              if (vNode.nodes.item(i).className === "field") {
                   if (vNode.ui.oneOfChild.className === "checkButton") {
                        if (vNode.items.nodes.length > 1) {
                             if (vNode.value.oneOfChild.value == 1) {
                                  nChk++ ;
              }else if (vNode.nodes.item(i).className === "subform"){
                   if (vNode.nodes.item(i).name === "Door_Subform"){
                        countChk(vNode.nodes.item(i));
         }//endloop
    Hope this help!

  • EVENTS WITH SCRIPTS not visible

    Hi,
    I am not able to see the events with scripts in the SHOW drop down.
    How can I get the above to have the calculations done?
    the version of the designer is 8.0
    Regards

    Hi,
    When it displays in the “default Calendar view” ,it shows "Event Permissions" option under EVENTS ribbon, this option can set permissions for a single
    event. Click
    ” List Settings “
    option under CANLENDAR ribbon, the "Permissions for this list” option can set permissions for the entire calendar.
     When it displays in the "All Events" view, it shows "Shared With" option both 
    in the ITEMS and LIST ribbon. This option under the ITEMS can set permissions for a single event. This option under the LIST can set permissions for the entire calendar.
    Best regards,
    Wendy 
    Wendy Li
    TechNet Community Support

Maybe you are looking for