:lol: guys… i need help…
how am i able to force logout the user using the applescript…
without any prompt…
u can use this
ignoring application responses
tell application "loginwindow" to «event aevtrlgo»
end ignoring
"«event aevtrlgo» "
It is an invisible and magical apple event which will instruct your computer to logout without a confirmation dialog.
If you wanna “FORCE” the user (without saving changes to documents, etc.), you may kill previosly all running aplications. Eg:
tell application "Finder" to file of application processes whose visible is true
repeat with i in result
if (i as text) does not end with "Finder.app:" and (i as text) does not end with "YOURNAME-HERE OR YOU WILL SUICIDE" then
do shell script "kill -14 `ps -xww | grep -i " & quoted form of POSIX path of i & " | grep -v 'grep' | awk '{print $1}'`"
end if
end repeat