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.
Page Index Toggle Pages: 1
Auto Run? (Read 720 times)
Auto Run?
Jul 25th, 2007, 3:09pm
 
Hi,
I am using Automator to launch Processing, and am trying to find out if there is away of having Processing 'Run' automatically. The code works, and won't be changed at all. Does anyone know if this is possible?

I have considered using applescript to do this(is Processing scriptable?), but as I don't know applescript I would rather do it in processing itself.

Any suggestions would be great,

Thanks for your help!!

Re: Auto Run?
Reply #1 - Jul 25th, 2007, 3:35pm
 
Why not export the sketch? And launch the application or html page. http://processing.org/reference/environment/export.html

If you need Processing to show in the background. You could start that first and then start the exported sketch with Automator.

I don't think there are any applescript interfaces or parameters you can use with processing. I haven't found any.
Re: Auto Run?
Reply #2 - Jul 25th, 2007, 4:02pm
 
Thanks for that.
I exported it and launched the application from automator and it works great. I wanted processing to stay hidden too, perfect.

Thanks again.
Re: Auto Run?
Reply #3 - Jul 30th, 2007, 4:32pm
 
I have run into a problem with this.
If i export the sketch as an application, the data folder does not update. I need the application to use a live data folder, as the image that processing displays needs to change every so often.
Is there a way around this? or am i just doing something wrong?

Thanks.
Re: Auto Run?
Reply #4 - Jul 30th, 2007, 5:27pm
 
what do you mean does not update? contents stay the same after exporting although changed in the original, or it can not be changed once exported?

you can just place your files inside the sketchfolder and processing will find them. it first looks for a data-folder (which resides inside the jar generated on export), then looks at the contents of the folder the sketch is run from.

sketch/
    file1.jpg
    file2.jpg

can be loaded via:

loadImage("file1.jpg");

but you have to manually move files next to the exported app to use it that way.

F
Re: Auto Run?
Reply #5 - Jul 31st, 2007, 1:09pm
 
Even if you found another solution... it is possible to "press play" with applescript. You can select menu-entries of every application from within applescript. So, you need to select Menu 'Sketch'->'Run'.

Applescript for this functionality can be found here:
http://www.macosxhints.com/article.php?story=20060921045743404

(scroll down and use Jacob Rus' method, it's nicer than than the one apple suggests).

copy the method "menu_click()" into your applescript file.
then this statements should work for you (not tested though):

tell application "Processing" to activate
menu_click({"Processing", "Sketch", "Run"})

You can then use this applescript as an Automator action.

cheers
Page Index Toggle Pages: 1