Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Stop processes when you go to the login window' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Stop processes when you go to the login window
Authored by: a1291762 on Mar 08, '04 06:49:43PM

If you want to ensure things aren't running (like iTunes/Classic, etc) disable FUS. Create an applescript to take you to the login window (search around here for it, there's a bunch of solutions like this: http://www.macosxhints.com/article.php?story=20031102031045417) and use that to "switch". I installed iKey (or some other global keyboard shortcut program) and assigned a key combo to switch to the login window. I also used ScriptSaver to call the loginwindow script.

The trick is to have the loginwindow script quit apps that shouldn't be running when you get to the login window. Like this:

tell application "iTunes" to quit
do shell script "killall TrueBlueEnv" -- not sure how to do this properly
do shell script "/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"

I can't verify this because I don't have a Mac with classic to test on.



[ Reply to This | # ]
Stop processes when you go to the login window
Authored by: dfbills on Mar 09, '04 01:05:07AM

How to you escape the space in "Menu Extras" for applescript while preserving the "\ " for the shell?



[ Reply to This | # ]
Stop processes when you go to the login window
Authored by: cougar718 on Mar 09, '04 11:44:43AM

Hello there,

You do not need to escape the space, you need to scape the \ delimiter with another \. So in the previous code posted you would put 2 backslashes instead of 1 like this...

set theResult to do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend"

Good luck

---
Rick alias cougar



[ Reply to This | # ]
Stop processes when you go to the login window
Authored by: michaelaskew on Apr 11, '04 03:41:17AM
That makes perfect sense, but just to show that there's more than one way to do things, here's how I did it: put single-quotes around the command (within the double quotes).

	do shell script "'/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession' -suspend"


[ Reply to This | # ]