Skip to content

Instantly share code, notes, and snippets.

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
end if
end tell
if no_app is 1 then
tell application "System Events"
{ "title": "Vimac - press right command",
"rules": [
{ "description": "Vimac - press right command",
"manipulators": [
{"from": { "key_code": "right_command" },
"parameters": {"basic.to_if_alone_timeout_milliseconds": 300,
"basic.to_if_held_down_threshold_milliseconds": 500},
"to_if_alone": [
{
-- user options
set KillWindows_User to {"app1", "app2"}
-- end of user options
-----------------------------------------------
-- s23.5 - supported: FreeFileSync
-- s23.4 - fixed: closing windows of Finder on Mac Catalina, hang caused by some apps | improved: killing apps listed in KillWindows_User
-- s23.3 - supported: Audacity
-- s23.2 - supported: wine-preloader, wine
-----------------------------------------------
{ "title": "Rules for Karabiner-Elements | Tested Version 12.10.0",
"rules": [
{ "description": "Rules for Karabiner-Elements - Hold a Key to Execute Right Click Menu Item",
"manipulators": [
{"from": { "key_code": "my_key" },
"parameters": {"basic.to_if_alone_timeout_milliseconds": 300,
"basic.to_if_held_down_threshold_milliseconds": 500},
"to_if_alone": [
{"key_code": "my_key"
}],
-- user options
set save_active_document to "off" -- "on" or "off"
set save_new_document_do_not_minimize to "off" -- "on" or "off"
-- end of user options
tell application "System Events"
set activeApp to (get name of first process where it is frontmost)
end tell
tell application "System Events"
set all_win_activeapp to name of window of process activeApp
end tell
# s28.1 - improved: getting current volume level
# This script is for volume level of sound output device >= 100%, but < 160%
# user options
notification = 'on' # 'on' or 'off'
# end of user options
#####################################################################################
info_sinks = system.exec_command("pacmd list-sinks | grep -Ei 'index:|active port:'")
all_lines = info_sinks.split("\n")
for line in all_lines:
-- s23.4 - fixed: closing windows of Finder on Mac Catalina, hang caused by some apps | improved: killing apps listed in KillWindows_User
-- s23.3 - supported: Audacity
-- s23.2 - supported: wine-preloader, wine
-- user options
set KillWindows_User to {"app1", "app2"}
-- end of user options
set input_list_choose to {"Kill and Shut Down", "Kill and Restart", "Kill All Windows"}
-- user input
set sound_user to "/Volumes/Data/mp3/123.mp3"
set time_sound to 4 -- seconds
set text_noti to "Mail from Jane"
set title_noti to "Read Carefully"
-- end of user input
-- user options
set sound_option to "on" -- "on" or "off"
-- end of user options
-- user options
set ignored_apps to {}
set get_name_of_active_app to "off" -- "on" or "off"
set default_button_of_dialog to "Quit" -- "Quit" or "Cancel"
-- end of user options
try
if get_name_of_active_app is "on" then
tell application "System Events"
set activeApp to (get name of first process where it is frontmost)
end tell
# Open app --> open -a "safari"
# Run AppleScript --> osascript "/Volumes/Data/Script/s44.scpt"
# Your code below.