Wake up display from NON sleeping mac

I need to write an applescript to wake up my macs display. I’ve searched and searched this forum but found nothing that simply would wake up a sleeping display for a non sleeping mac.

The reason I need this is I’m using securityspy to monitor a camera and when motion is detected by the camera I want it to wake up the display. securityspy has the option to run a script and already brings the app to the foreground but doesn’t seem to wake the screen.

TIA! :rolleyes:

Just as long as the monitor is asleep this should work.

tell application "System Events"
	tell process "Finder"
		keystroke space
	end tell
end tell 

but if your entire system is asleep, aka deep sleep with the pulsing power button, this will not work.

Thanks for the solution. Works great!!!

Hello, I too have securityspy and suffer from this delema. But when this or any scritps are run by securityspy instead of running the script, script editor opens it. If I save as a run only I get an error message stating: “Unable to read the file because the script is not editable (it was saved as run-only).”

Don’t laugh this is the first time I have needed to use a script.

I recall having a similar problem with this but after choosing the right options, it worked for me. Works great.

i saved it as:

file format: script
options: run only, no startup screen and don’t check stay open

save it in the scripts folder for security spy

Hope that works for you.

Thanks for replying,
unfourtunatly this did not work for me. I still get the same error stated above. I think my computer opens the file inplace of running the script, but it will run it when selected from the drop down menu they run fine. It must be a setting or something. I’m sure the script is fine because the space bar would work great to wake the display.

You are running it from within SecuritySpy using the camera setup/actions tab right? From your post, it seems you are.

Have you tried emailing Ben at SecuritySpy?

Model: PowerBook 17 167MHz
AppleScript: 1.10
Browser: Safari 412.2
Operating System: Mac OS X (10.4)

Yes I am selecting the correct script within Securityspy, box checked and all, and I have now tried saving the script with all possibilies from the save as menu. Securityspy does try to run the script when motion is detected, but the script is opend in the editor instead or running it. E-mailing Ben was my next coarse of action.

Model: iMac G5 1.8 20" 2GB DDR
AppleScript: ?
Browser: Safari 412.5
Operating System: Mac OS X (10.4)

If you figure this out please post back here. I’m curious what could cause that behavior.

Well, I JUST FEEL STUPID, I posted an other question addressing the same issue above and Nigel Garvey Wrote:
Hi, pierreg.

That’s the correct behaviour. If you want a saved script to run when you double-click it, you have to save it as an application. There’s a pop-up menu called “File Format:” (on English-language systems) in the “Save As…” dialog. You can select “Application” from there.

If you check the “Run Only” box, the script will be saved without its source text and you won’t be able to read or edit the file. Don’t do that unless you’ve also saved a version that isn’t run only!

Works like a charm!

Thanks so much storrence, Nigel Garvey, and last but not least the man with the solution, dmccoy26.

That is what I suspected was the problem because I had the same experience when I didn’t save it as an app. Another problem I had but haven’t solved is if you save it to stay open after launch then it doesn’t work on subsequent triggers. I would prefer for it to stay open since it’s constantly being used and it would also quicken it’s response time to motion when camera senses motion.

Anyone have any ideas why setting it to ‘stay open’ would cause it to not work on subsequent triggers.

tell application "System Events"
	tell process "Finder"
		keystroke tab
		say "Driveway Camera"
	end tell
end tell


Add a reopen handler to your script:

on reopen
end reopen


Works :slight_smile: Much faster to respond now on subsequent alerts.