Skip to content

Instantly share code, notes, and snippets.

-- user options
set create_group to "off" -- "on" or "off"
-- end of user options ---------------------------------
-- get name of all windows
if create_group is "off" then
set list_all_windows to {}
tell application "System Events"
set allWindows to name of window of processes whose visible is true
end tell
-- user input - hotkey of 'all windows' in HyperSwitch
set hotkey to "command" -- "option" or "command" or "control"
-- end of user input - hotkey in HyperSwitch
-- user options - "lr" = left and right | "tb" = top and bottom
set position to "lr"
-- end of user options
set screen_w to (do shell script "system_profiler SPDisplaysDataType | awk '/Resolution/{print $2}'")
set screen_h to (do shell script "system_profiler SPDisplaysDataType | awk '/Resolution/{print $4}'")
set in2_screen_w to screen_w / 2
-- user options
set bookmark to "off" -- "on" or "off", to run script set bookmark to "off"
set text_continue_reading to "off" -- "on" or "off"
set instruction to "on" -- "on" or "off"
-- end of user options
set theFile to (path to applications folder as text) & "MouseTools"
tell application "Finder"
if not (exists file theFile) then
-- Download cliclick > https://www.bluem.net/en/projects/cliclick/
-- Download MouseTools > http://www.hamsoftengineering.com/codeSharing/MouseTools/MouseTools.html
-- Put cliclick and MouseTools in Applications folder
-----------------------------------------------------------------
set theFile to (path to applications folder as text) & "MouseTools"
tell application "Finder"
if not (exists file theFile) then
set no_app to 1
else
set no_app to 0
-- user input
set SizePos to {227, 26, 741, 653}
-- end of user input
tell application "System Events"
set activeApp to (get name of first process where it is frontmost)
end tell
if activeApp is "Google Chrome" then
tell application "Google Chrome"
set Chrome_winName to get title of front window
end tell
-- tested version: Finder 10.10.4
set Replace_Me to "abc"
-- user input (up to 20)
set input1 to Replace_Me
set input2 to Replace_Me
set input3 to Replace_Me
set input4 to Replace_Me
set input5 to Replace_Me
set input6 to Replace_Me
set input7 to Replace_Me
set Replace_Me to "abc"
-- user input (up to 30) - position, size and name of window
set input1 to Replace_Me
set input2 to Replace_Me
set input3 to Replace_Me
set input4 to Replace_Me
set input5 to Replace_Me
set input6 to Replace_Me
set input7 to Replace_Me
set input8 to Replace_Me
tell application "System Events"
set activeApp to (get name of first process where it is frontmost)
end tell
delay 0.03
set Replace_Me to "abc"
-- user input (up to 20) - based on active app name
set input1 to Replace_Me
set input2 to Replace_Me
set input3 to Replace_Me
set input4 to Replace_Me
-- user options
set KillWindows_User to {"app1", "app2"}
set KillWindows_with_window to {"BCompare", "gimp", "soffice"}
set output_volume_before_shutdown_and_restart to "off" -- "on" or "off"
set output_volume to 0 -- you can set from 0 - 100
-- end of user options
-- If script is interrupted by dialog "Choose Application" with message "Where is (app name)?", put the app name in the list "KillWindows_with_window".
-----------------------------------------------
set input_list_choose to {"Kill and Shut Down", "Kill and Restart", "Kill All Windows"}
set user_input to (choose from list input_list_choose with prompt "" with title "Script 23.13")
-- user options
set KillWindows_User to {"app1", "app2"}
set KillWindows_with_window to {"BCompare", "app2"}
set output_volume_before_shutdown_and_restart to "off" -- "on" or "off"
set output_volume to 0 -- you can set from 0 - 100
-- end of user options
-----------------------------------------------
set input_list_choose to {"Kill and Shut Down", "Kill and Restart", "Kill All Windows"}
set user_input to (choose from list input_list_choose with prompt "" with title "Script 23.12")