7 Replies Latest reply on Jun 22, 2006 6:09 AM by Newsgroup_User

    sending "ok" command to other application

    PeterDeMan
      hi lingo people,

      Because ppl like my work and ask for more, I wrote a new program for an art installtion (yes again :)
      this time its a complete room (4 by 4 by 5 meter) with moving roof parts lights and sounds, sonar and sound detection :D

      i got midi in and out working, saving and loading setting files also, doing light controlling and even motor controlling :D
      got the sonars up and running, sound detection also and even the intraction script are nice :D so it all works great !!!! but...

      The problem i have now is that when booting the pc and autostart all needed files "ableton live" (where the samples and sound fx are played, trough MIDI triggered by lingo / MIDIio) sometimes gives a prompt like "restore previous file blababla continue: Yes or No". This occures when somebody pulled the plug by accident from the computer (these kinda things DO happen during expositions or festivals).

      users can't see the screen at all... the computer is hidden in the installation itself.
      i wrote a trap that can detect this situation already (sending test midi command and check if comes back in lingo, if not something is wrong)... so what i need to do then, is click the "Yes" button and ableton live loads the file and the installation sound is up again. but as i'm not always there and the computer is hidden i want to let lingo press the "yes" button for me...

      does anyone how it is done?
      if somebody knows how to do it in a *.bat file or an *.wsf file or anything it will do also... as i can start that file from lingo again...
      anyone?

      question:
      how can one click on the "Yes" button at an alert popup generated by another application?
      or
      how can is select another program (like alt tab) and fake a "Y" press on the keyboard?

      thanx in advance,
      Peter de Man
        • 1. Re: sending "ok" command to other application
          Level 7
          how can one click on the "Yes" button at an alert popup generated by
          another
          > application?
          > or
          > how can is select another program (like alt tab) and fake a "Y" press on
          > the
          > keyboard?

          check out:

          keyboardControl Xtra (meliorasoft.com)
          KeyboardControlSendKeys("yourKey")

          or:

          buddyApi xtra (mods.com.au)
          :baSendKeys( "{ENTER}" )

          what kind of hardware do you, by the way, use to control the light?.
          Director <-> Midi -> DMX -> Dimmer , or?


          • 2. Re: sending &quot;ok&quot; command to other application
            Level 7
            I second the recommendation for BuddyAPI. It has a few functions that
            you might find useful, like baWindowList which will tell you all the
            open windows, baWindowToFront which will let you move that error dialog
            to the front, and baSendKeys which will let you send an Enter key to
            dismiss the dialog.
            • 3. Re: sending &quot;ok&quot; command to other application
              PeterDeMan Level 1
              hi Anders Skov ,

              for light i use:
              lingo -> MIDIio -> MIDIMate (usb midi device) -> digipack 4 slot dimmer -> lights
              this model supports midi and dmx, a cheaper version only supports DMX.

              for smaller setups this is cheaper (dont need midi->dmx box) and works ok.
              but next project i will have more lamps... if i want them to glow (at 15 updates a sec)
              this will be to slooooow...
              so then i will use a serial -> dmx converter... some of these can accept fade commands and will send all needed dmx commands for you.... this will save the cpu of lots of commands and wainting time :D.... only the lamp number fade speed and goal brightness need to be send once... :D the unit will send the dmx fade steps

              thanx again, I will checkout those xtra's...
              but to be honest, i bought so many xtra's already and my budget is kinda empty...
              and it sounds like a simple task (its not doing FFT analyses or something)
              you should be able to do in a simple external tool also..

              is there not a sendKey.exe which you can send a argument like:
              sendKey.exe -Y

              or maybe this can be done by some kind of windows api command, i mean i can make and call batch files for free...
              and also windows script files (*.wsf) are known to be able to do this kind off stuff.
              i made myself a shutting down sequence button and reboot button in lingo etc.. all done by *.bat files i call from lingo.

              anyone?

              greetingz,
              Peter de Man
              • 4. Re: sending &quot;ok&quot; command to other application
                Level 7
                > for light i use:
                > lingo -> MIDIio -> MIDIMate (usb midi device) -> digipack 4 slot dimmer ->
                > lights
                > this model supports midi and dmx, a cheaper version only supports DMX.

                And it's stable (MIDI -> MIDIMate)?

                > so then i will use a serial -> dmx converter... some of these can accept
                > fade
                > commands and will send all needed dmx commands for you.... this will save
                > the
                > cpu of lots of commands and wainting time :D.... only the lamp number fade
                > speed and goal brightness need to be send once... :D the unit will send
                > the dmx
                > fade steps

                In some boxes/mixers one can save a "stage", completely containing fades,
                time and so - then one can trigger a new stage via Midi. Never had the
                chance to try that though.

                > but to be honest, i bought so many xtra's already and my budget is kinda
                > empty...

                Well, in buddyApi, you'll have 2 functions for free.

                > is there not a sendKey.exe which you can send a argument like:
                > sendKey.exe -Y

                Try to check out:
                http://www.nirsoft.net/utils/nircmd.html
                New functions have been added since I used it - see under the command: win.
                I do not have the time to test now. If it can't do the job, it's a great
                little tool for other tasks in windows

                > or maybe this can be done by some kind of windows api command, i mean i
                > can
                > make and call batch files for free...
                Yes, I'm sure there must be.

                What app give you that annoying error?
                All my installations are shut down the hard way every night, and I do not
                have this issue.


                • 5. Re: sending &quot;ok&quot; command to other application
                  PeterDeMan Level 1
                  thanx mike,

                  i think indeed BuddyApi is the best way to go.

                  greetingz,
                  Peter de Man
                  • 6. Re: sending &quot;ok&quot; command to other application
                    PeterDeMan Level 1
                    hi Anders Skov ,

                    I used midiIO xtra on 5 projects and some of them have run for months (non stop) and some are shut down daily by pulling the plug. never had a problem. I used PCI soundcards USB soundcards and also USB MIDI devices, gameports, and wave tables also i used virtual midi ports and with ssome projects a combination of those at the same time.. never had 1 glitch on that part.

                    what is th problem now is that for the first time i use ableton live (audio program) as THE main audio engine instead of the one in director. so i controll this killer app with lingo -> midi.... so it changes the volume faders and fx knobs (which i like). But when you just pull the plug "ableton live" thinks it was an accident.. (as you didnt save or closed the file without saving) next time it will ask if you want to go back to the original or the "modified" version.... (just like Word sometimes asks)... for the project it doesnt't matter the faders will be placed at the right spot by lingo anywayz,... so if you click then yes or no doesnt matter as long as if you click something.... hope this explaines

                    btw. the nircmd tool you mentioned is great i used it on antoher project.. but it lacks the ability to sendKeyStroke :S

                    thanx for the visions, ill think ill go for buddyApi,
                    Peter de Man
                    • 7. Re: sending &quot;ok&quot; command to other application
                      Level 7
                      Hi Peter
                      Nice project, and tks. for all the info.
                      Good luck.