Scripts

Discussion in 'Mac Programming' started by MarkW19, Dec 19, 2007.

  1. MarkW19 macrumors 65816

    Joined:
    Sep 13, 2002
    Location:
    Surrey, UK
    #1
    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.
     
  2. prostuff1 macrumors 65816

    prostuff1

    Joined:
    Jul 29, 2005
    Location:
    Don't step into the kawoosh...
    #2
    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
     
  3. MarkW19 thread starter macrumors 65816

    Joined:
    Sep 13, 2002
    Location:
    Surrey, UK
    #3
    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.
     
  4. MarkW19 thread starter macrumors 65816

    Joined:
    Sep 13, 2002
    Location:
    Surrey, UK
    #4
    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.
     
  5. prostuff1 macrumors 65816

    prostuff1

    Joined:
    Jul 29, 2005
    Location:
    Don't step into the kawoosh...
    #5
    glad that everything is working and glad i could help
     

Share This Page