log out and re-log on other user ?

I
Can we perform a script who log out from current user and re-log on other user (like amin or root) and continue to perform the same script ? And how ?

Thanks!!!

I am not quite sure what you exactly want to accomplish.
You can run scripts as admin in various ways, e.g. sudo OSAscript mechanisms (Google-up these words for examples).
Logging out and then subsequently performing Applescripts may appear difficult, as the AS scripting mechanism depends on a executing entity that gets lost when logged out.
However, you may script a machine restart resulting in the default log-in config.

Allternatively, you can attach AS actions on the log-in/out actions themselves.
See Mult. Users Actions (http://www.versiontracker.com/dyn/moreinfo/macos/8266)

Theoretically, you could use WinSwitch (http://www.versiontracker.com/dyn/moreinfo/macosx/22935) and Quickeys to log in as another user, then use a Mult. Users Actions script to log-out the former user. But it will be more of a hassle, I am afraid.

Eelco Houwink