We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Getting another application to do something
Page Index Toggle Pages: 1
Getting another application to do something (Read 2452 times)
Getting another application to do something
Mar 6th, 2010, 3:02pm
 
Hi,

I'm running my processing sketch, as well as a second (non processing) application.  Does anyone know how to control the second application from within processing?  

Right now, to get the non processing application to do something, I need to click on its window, and then I need to press the keys "shift", "command", and "s".  It'd be great if I could get this to happen from within processing.

thanks,  Smiley
~Patch

Re: Getting another application to do something
Reply #1 - Mar 6th, 2010, 3:28pm
 
search for 'robot' - it lets you move the mouse from within a program. not sure you'll be able to do what you want with it - it might be limited to the processing window but...

is this windows? does windows have anything like gnome's dbus or kde's dcop or even the old amiga arexx system? corba, is that the same kind of thing? there's a java port of corba you might be able to use. i'd try the robot first.

what's the other app doing?
Re: Getting another application to do something
Reply #2 - Mar 6th, 2010, 4:34pm
 
Hi,

My operating system is Mac OS X.  The other application is controlling a "Dinoscope", (USB microscope).  Making the Dinoscope application active, and then pressing "shift", "command", and "s" causes it to capture an image and save it to a directory.  All the code I've written so far for processing the image after it's put in the directory works great.  But I'm stumped about getting the image capture to happen from within Processing.  

I was hoping to do this from within Processing as follows:
1. some command that returns a list of all applications currently running on the computer.
2. make the Dinoscope application "active", (same as clicking anywhere on it's GUI window).
3. text input "shift", "command", and "s"
4. return "active" status to my Processing app.

Any help (or suggestions) would be greatly appreciated.  

thanks again,  Smiley
~Patch
Re: Getting another application to do something
Reply #3 - Mar 7th, 2010, 2:38am
 
Well, as koogy said, look at Robot Java class, it should do what you request.
Re: Getting another application to do something
Reply #4 - Mar 7th, 2010, 3:02am
 
then what about applescript? write something that'll poke the microscope and save the image to a known file, change the processing sketch to poll that file every now and again (make sure it's complete before you start processing it though).
Re: Getting another application to do something
Reply #5 - May 15th, 2010, 7:15am
 
hey patch, did you get the thing working? I'm also trying to capture video from a usb microscope through processing, but it doesn't seem to like this sort of input. I was hoping that it might interpret it like a web cam, but njet. And I really don't wanna go about the crappy app that followed the microscope (called "MicroCapture" btw..)
any tips?
-macu
Re: Getting another application to do something
Reply #6 - May 15th, 2010, 7:53am
 
never mind, I got it working..
Page Index Toggle Pages: 1