Script 23 - Kill All Windows without Saving on Mac

Fixed: code
 
Added: command 'quit' for apps that can not be killed with command 'do shell script ("kill -9 " & the_pid)' such as Apple Calendar app
 
Fixed: code
Added: sublime_text in option 'KillWindows_with_window'
 
Added: "gimp" and "soffice" in user option 'KillWindows_with_window'
Improved: quitting apps with command 'quit saving no'
 
 
Done: code restructuring
 
 
Supported: App 'Sublime Text'
 
 
Removed: checking connection of magic mouse/keyboard before shutting down
Added:  user options - set output volume before shutdown and restart (in order to prevent a high volume level of startup chime)


How-to for new options:
1. Set output_volume_before_shutdown_and_restart to "on"
2. Set output_volume to 0 
You can set volume level from 0 - 100. 0 = volume is muted.
 
 
macOS Monterey breaks the code. To run script without problems, you must set user options: display_dialog_if_magic_mouse_or_magic_keyboard_connected to "off"
Fixed: Getting wrong Blutooth connection value when other device is connected.
 
Added: Option - display_dialog_if_magic_mouse_or_magic_keyboard_connected in 'kill all and shut down' mode
Instructions: 
1. Get name of device - system preferences > bluetooth
 


2. Edit script: Open script file, at user options,  set display_dialog_if_magic_mouse_or_magic_keyboard_connected to "on" ( or "off")
set keyboard to "Magic Keyboard" (name of device)
set mouse to "Magic Mouse 2" (name of device)
 
 
 
3. Dialog

 
Fixed: Script interrupted by dialog  'Choose Application'
Instructions: After running the script, if dialog 'Choose Application' interrupts the process, open the script file and set KillWindows_with_window to {"name of app"} at 'user options' section -- > from picture below (click to enlarge), set KillWindows_with_window to {"BCompare"}.
 

 
 
Supported: TextMate

Supported: FreeFileSync
 
Fixed: closing windows of Finder on Mac Catalina, hang caused by some apps 
Improved: killing apps listed in KillWindows_User

Download Script 23.3
Supported: Audacity
 
Download Script 23.2
Supported: wine-preloader, wine

Download Script 23.1
Fixed: killing windows of unsaved 'Atom' documents
Improved: getting process ID


Download Script 23