wake from sleep

Andre Garzia andre at andregarzia.com
Tue Aug 11 10:25:08 EDT 2009


Thomas,

I had to much coffee so the solution I thought is the most weird one you'll
ever see.

Create a simple image on your stack, then do something like:

   export snapshot from rect (the rect of img 1) to file
"~/Desktop/teste.jpg" as JPEG

wherever you want to check if the screensaver is running. You can also use
import snapshot which is better, or put the file in a better place. The
thing is, if you check the pixels in the imported image, they won't match if
the screensaver is running (or if another window is on top).

So, you can create this image on a offscreen coordinate in a temporary stack
that floats on top of everything, this way it will never ovelap. Then you
import and check the pixels. If they don't match something like a
screensaver is running filling all screen. If they do match then you're on
"interaction" mode....

should not drink much coffee.

andre



On Tue, Aug 11, 2009 at 1:51 PM, Thomas McGrath III <mcgrath3 at mac.com>wrote:

> Is there a simple way to tell via a script when the system wakes from sleep
> or when it wakes from screensaver?
>
> I have (on Mac) my screensaver set to require password on wake and would
> like my stack to do something when it wakes.
>
> I tried a small applescript in the loginItems in Preferences but that is
> only on login and not when it wakes from sleep/screensaver.
>
> Maybe a shell command????
>
>
> Thanks
>
>
> Tom McGrath III
> Lazy River Software
> 3mcgrath at comcast.net
>
> iTunes Library Suite - libITS
> Information and download can be found on this page:
> http://www.lazyriversoftware.com/RevOne.html
>
>
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list