Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Improved formatting, making it clearer that some of this question is quoted from elsewhere
Source Link
Ashley
  • 4.2k
  • 2
  • 25
  • 40

I work at a store, which sells appleApple computers. I’m

I’m trying to find a way to close all open programs after a few minutes. It’s because of our Shop Demo Account for customers. After opening all windows, it’s quite messy and I want to get a clean user experience.

All I would need is to close all windows. It should work like the command:

killall -u admin

killall -u admin

BUT without admin permission

AND after 1 min, 

WITHOUT user interaction.

Maybe, there is a way to: close all windows and programs, without showing something like „do"do you really want to“to", log out the demo account, and reload.

I found this, after searching some time, but I don't know if that's what I was looking for and how to make it work


Apple Script Log Out:

on run tell application "System Events" to log out end run


You can wrap this up in a bash alias using the osascript command: alias maclogout="osascript -e 'tell application "System Events" to log out'"

It is the same as clicking " > Log out [username]...", and will logout after a 2 minute wait

This is easily combined with the sleep command: alias delayedlogout="sleep 3600; maclogout"

..or could be combined into a single alias:

alias delayedlogout="sleep 3600; osascript -e 'tell application "System Events" to log out'"


Apple Script Log Out:

on run tell application "System Events" to log out end run


You can wrap this up in a bash alias using the osascript command: alias maclogout="osascript -e 'tell application "System Events" to log out'"

It is the same as clicking " > Log out [username]...", and will logout after a 2 minute wait

This is easily combined with the sleep command: alias delayedlogout="sleep 3600; maclogout"

..or could be combined into a single alias:

alias delayedlogout="sleep 3600; osascript -e 'tell application "System Events" to log out'"

Could someone please give me ansome advice? Thanks!

I work at a store, which sells apple computers. I’m trying to find a way to close all open programs after a few minutes. It’s because of our Shop Demo Account for customers. After opening all windows, it’s quite messy and I want to get a clean user experience.

All I would need is to close all windows. It should work like the command:

killall -u admin

BUT without admin permission

AND after 1 min, WITHOUT user interaction

Maybe, there is a way to: close all windows and programs, without showing something like „do you really want to“, log out the demo account, and reload.

I found this, after searching some time, but I don't know if that's what I was looking for and how to make it work


Apple Script Log Out:

on run tell application "System Events" to log out end run


You can wrap this up in a bash alias using the osascript command: alias maclogout="osascript -e 'tell application "System Events" to log out'"

It is the same as clicking " > Log out [username]...", and will logout after a 2 minute wait

This is easily combined with the sleep command: alias delayedlogout="sleep 3600; maclogout"

..or could be combined into a single alias:

alias delayedlogout="sleep 3600; osascript -e 'tell application "System Events" to log out'"

Could someone please give me an advice? Thanks!

I work at a store, which sells Apple computers.

I’m trying to find a way to close all open programs after a few minutes. It’s because of our Shop Demo Account for customers. After opening all windows, it’s quite messy and I want to get a clean user experience.

All I would need is to close all windows. It should work like the command:

killall -u admin

BUT without admin permission

AND after 1 min, 

WITHOUT user interaction.

Maybe, there is a way to: close all windows and programs, without showing something like "do you really want to", log out the demo account, and reload.

I found this, after searching some time, but I don't know if that's what I was looking for and how to make it work:


Apple Script Log Out:

on run tell application "System Events" to log out end run


You can wrap this up in a bash alias using the osascript command: alias maclogout="osascript -e 'tell application "System Events" to log out'"

It is the same as clicking " > Log out [username]...", and will logout after a 2 minute wait

This is easily combined with the sleep command: alias delayedlogout="sleep 3600; maclogout"

..or could be combined into a single alias:

alias delayedlogout="sleep 3600; osascript -e 'tell application "System Events" to log out'"

Could someone please give some advice? Thanks!

Source Link
Lars
  • 1
  • 1

Close all programs after 1min without user interaction

I work at a store, which sells apple computers. I’m trying to find a way to close all open programs after a few minutes. It’s because of our Shop Demo Account for customers. After opening all windows, it’s quite messy and I want to get a clean user experience.

All I would need is to close all windows. It should work like the command:

killall -u admin

BUT without admin permission

AND after 1 min, WITHOUT user interaction

Maybe, there is a way to: close all windows and programs, without showing something like „do you really want to“, log out the demo account, and reload.

I found this, after searching some time, but I don't know if that's what I was looking for and how to make it work


Apple Script Log Out:

on run tell application "System Events" to log out end run


You can wrap this up in a bash alias using the osascript command: alias maclogout="osascript -e 'tell application "System Events" to log out'"

It is the same as clicking " > Log out [username]...", and will logout after a 2 minute wait

This is easily combined with the sleep command: alias delayedlogout="sleep 3600; maclogout"

..or could be combined into a single alias:

alias delayedlogout="sleep 3600; osascript -e 'tell application "System Events" to log out'"

Could someone please give me an advice? Thanks!