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


Click here to return to the '10.3: Kill another user logged in under Fast User Switching' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Kill another user logged in under Fast User Switching
Authored by: nvdingo on Dec 01, '03 11:44:37AM

This is not tested, but under other *nixes, if you su to root, you can then su to the other username without their password (you are root after all)

in MacOS X, it would theoretically be possible to become the other user and run an applescript to kill their apps with saving, yes?

I am not an applescript guru. (IANAAG)
i am barely functional in applescript beyond the most basic script.

But shouldn't this be possible?

you can run them from a command line with osascript command.

wouldn't it be something like
get a list of all running applications (in the foreground)
for each app get a list of open documents
save each document into a special folder
quit app
then quit login for that user. (would telling the finder to logout work?)

that's my suggestion. I am open to hearing why this might not work. like i said, IANAAG.
and any feedback on this idea, would help advance mylimited AS knowledge



[ Reply to This | # ]
10.3: Kill another user logged in under Fast User Switching
Authored by: diamondsw on Dec 01, '03 11:59:53AM

If everyone implemented AppleScript properly, that would work fine. Sadly, very few applications actually properly support the language with identical syntax. Photoshop Elements comes to mind...



[ Reply to This | # ]
10.3: Kill another user logged in under Fast User Switching
Authored by: schwa on Dec 01, '03 12:11:13PM

Doesn't work unfortunately. I get told by osascript that '0:22: execution error: No user interaction allowed. (-1713)'.

SOL.



[ Reply to This | # ]
10.3: Kill another user logged in under Fast User Switching
Authored by: Clint MacDonald on Dec 01, '03 04:27:45PM
in MacOS X, it would theoretically be possible to become the other user and run an applescript to kill their apps with saving, yes?

Actually, before submitting this hint, I tried writing an AppleScript to logout a user, then su to that user and do a

open -a logoutscript.scrpt

Unfortunately, all it did was log out my current user.



[ Reply to This | # ]
open doesn't work here!
Authored by: dom on Dec 01, '03 05:21:29PM
open
always opens as the current logged-in user. Instead, try this:
su other_acct_name
/Applications/logoutscript.scpt
or, in one line:
su other_acct_name -c /Applications/logoutscript.scpt


[ Reply to This | # ]
10.3: Kill another user logged in under Fast User Switching
Authored by: tris on Dec 01, '03 09:25:36PM

Alternately....
A good shove down some steps or a thump with a stout stick will knock off most other users !



[ Reply to This | # ]