Skip to content

Instantly share code, notes, and snippets.

View Mouse Chording - Karabiner-Elements Rule.txt
{ "title": "Mouse Chording - Karabiner-Elements Rule",
"rules": [
{
"description": "Mouse Chording - Karabiner-Elements Rule",
"manipulators": [
{
"type": "basic",
"conditions": [{ "type": "frontmost_application_if",
"bundle_identifiers": [
View script 58.txt
tell application "Flux" to launch
delay 2
tell application "System Events"
set inviApps to (get name of every application process whose visible is false)
end tell
repeat until "Flux" is in inviApps
delay 1
tell application "System Events"
set inviApps to (get name of every application process whose visible is false)
end tell
View script 23.14.txt
-- user options
set KillWindows_User to {"app1", "app2"}
set KillWindows_with_window to {"BCompare", "gimp", "soffice", "sublime_text"}
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
-- option 'KillWindows_User' is desinged for killing apps that sit in the menubar. If the name of app is not correct (case sensitive), that app won't be killed. To check a name of menubar app, use this code -- tell application "System Events" to set frontapps to get the name of every process whose background only is true -- copy from 'tell' to 'true' then paste in Script Editor, click menu 'Script', click 'Run', check the name in tab 'Result' at the bottom.
-- option 'KillWindows_with_window' is for the situation when 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
View script 53.txt
-- user options ----------------------------------------------
set file_name to "untitled"
set file_name_with_current_date_time to "on" -- "on" or "off
set extension to ".txt"
-- end of user options ---------------------------------------
tell application "Finder"
activate
View script 30.4.txt
-- 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
View script 25.1.txt
-- 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
View script 16.1.txt
-- 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
View script 37.1.txt
set list_total_condition to {}
----------------------------------------------------------------------
-- user input - add apps/files
set F1_1 to ""
set F1_2 to ""
set F1_3 to ""
set F1_4 to ""
set F1_5 to ""
set F1_6 to ""
set F1_7 to ""
View script 36.2.txt
-- 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
View script 35.1.txt
-- 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