Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MarkW19

macrumors 65816
Original poster
Sep 13, 2002
1,209
1
Surrey, UK
I'd just like to get/make a simple script, that quits a specific application (Mail), both when I manually turn my locked screensaver on (using a hot corner), or use Fast User Switching to change to another user.

Is there a way to do this?

Thanks for any help.
 

prostuff1

macrumors 65816
Jul 29, 2005
1,482
18
Don't step into the kawoosh...
I found a solution that should work (does for me) when activating the screen saver. It is kinda what you want but not exactly (i think).

Download ScriptSaver and install it. Then open Script Editor and past this into the window
Code:
try
	quit application "Mail"
end try

Save it as a script and then set it as the script to activate when the screen saver starts. If you would like you can even make a script like
Code:
try
tell application "Mail" activate
end try

to restart mail when the screen saver is deactivated.


As far as fast user switching is concerned there is another screen saver called Caio that, when set in the options panel, will bring up the fast user switching dialog.

basically download the two screen savers and install them. Then set up Caio to go to the fast user switching screen after a certain period of time. Then go to the ScriptSaver screensaver and set it to activate the above script when the screensaver activates. Select the Caio screensaver as the one you want and everything should work, kinda like you want.

Hope that helps
 

MarkW19

macrumors 65816
Original poster
Sep 13, 2002
1,209
1
Surrey, UK
Fantastic, thanks for your help. I'll give it a go now.

I want to do this in case I forget to quit Mail, and want to check new mail on my iPhone or elsewhere (I can't get IMAP working for my ISP on my iPhone, so as soon as Mail has downloaded the new messages, they're gone from the server.
 

MarkW19

macrumors 65816
Original poster
Sep 13, 2002
1,209
1
Surrey, UK
I've sorted out ScriptSaver, and it works great, thanks. It quits Mail whenever my screensaver activates.

But, I've tried to create another Script, to re-activate Mail, but I can't save the Script you pasted in Script Editor. I get the error "Syntax Error, Expected end of line but found command name". Can you help?

Also, with fast user switching, I wanted to be able to change to another user, which would then quit Mail for me when the user is changed. But, I can't figure out a way to that with Ciao? It just brings up the fast user switching dialog after a certain time, doesn't it?

Thanks.

EDIT: I've sorted the re-activate script:-

try
activate application "Mail"
end try

works.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.