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 › Processing as screensaver in Mac OS X the hard way
Page Index Toggle Pages: 1
Processing as screensaver in Mac OS X the hard way (Read 4299 times)
Processing as screensaver in Mac OS X the hard way
Jan 24th, 2009, 2:40am
 
edit: Sorry for getting the hope up, but it doesn't seem to work as stable as I thought. Though maybe someone can take a look and think of a way to let it work better?

I'm not sure where to put this post, so correct me if I'm wrong.

I was looking for a way to use a processing file as my screensaver on Mac OS X but couldn't find a way to do this on the forums, so I started trying some things and I found a way that works. It's not the tidiest way to do it: you can't really put it online for others to install or something, but it works if you want to use a processing app on your own system.

1) Make sure you've got this in your processing code:
Code:
void keyPressed(){
 exit();
}
void mouseMoved(){
 exit();
}


2) Export your file as a Mac OS X application. Make sure to check 'Full Screen'.

3) Save the following text as an applescript (replace the myApp.app with your filename):
Code:

tell application "ScreenSaverEngine" to quit
tell application "omg_glowing_fishies_hd"
     activate
end tell
and save it in the same folder as your app.
It will stop the screensaver and start your app (when trying this using hot corners you'll see the menu bar).

4) Download ScriptSaver (by Matt Swann); it allows you to run a applescript file when the screensaver starts and stops. Choose the previous applescript as startup script in the ScriptSaver settings. Set 'screensaver'  to none and leave the endscript empty.
You can find ScriptSaver here: http://swannman.wordpress.com/projects/scriptsaver/

You're all set.

As said before, it might not be the best way, but it does the job.
**maybe it's also possible to quit the screensaver app with an applescript instead of the keyPressed/mouseMoved codes, but it didn't work for me (the screensaver would start, the app would open, but closed immediately**
Re: Processing as screensaver in Mac OS X the hard way
Reply #1 - Jun 26th, 2009, 2:16pm
 
A while back I made a Cocoa screensaver that just displays a WebView pointed to whatever URL you configure it to.  In my case the URL had a fullscreen flash application, but it could just as easily be a page with a Processing applet on it.

Here is the source code: oops I'm not allowed to post links until I've posted more messages.  I'll post it on my blog at lux.vu

You just have to edit the URL in the source, recompile and then double click the WebScreenSaver.saver product.

-josh
Page Index Toggle Pages: 1