Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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")
"""
Requirements:
1. merge_images.py from https://github.com/255/merge-images/blob/master/merge_images.py (and requirements for running script)
2. yad (sudo apt install yad)
3. AutoKey (with gtk+, install via Ubuntu Software)
---------------------------------------------------
tested on AutoKey 0.95.10, Ubuntu 20.04.3 LTS
"""
import subprocess
import os
from datetime import datetime
utime = datetime.now()
utime2 = utime.strftime("%Y_%m_%d_%H.%M.%S")
output_file = '/Users/john/Desktop/output-combine_images_%s.png' % utime2
script_file = '/Users/john/Desktop/ori.py'
column = 0
-- 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"}
-- 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"}
tell application "System Events"
set activeApp to (get name of first process where it is frontmost)
end tell
tell application "System Events"
tell process activeApp
set docPath1 to value of attribute "AXDocument" of window 1
end tell
{
"title" : "Eject Key - Capture Full Screen | Hold - Selection",
"rules" : [
{
"description" : "Eject Key - Capture Full Screen | Hold - Selection",
"manipulators" : [
{
"from" : {
"consumer_key_code":"eject"
},
-- Adjust resolution in Preview
-- open system preferences > keyboard > tab 'Shortcuts' > check 'Use keyboard navigation to move focus between controls'
-- user input
set resolution to "144"
-- end of user input -----------------------------------
if application "Preview" is running then
set prun to 1