Skip to content

Instantly share code, notes, and snippets.

View script 50.txt
-- 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
View script 44.1.txt
-- 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
View script 49.txt
# Open app --> open -a "safari"
# Run AppleScript --> osascript "/Volumes/Data/Script/s44.scpt"
# Your code below.
View script 48.txt
-- user input
set bt_device to "HOCO ES11"
-- end of user input
set aa to do shell script "system_profiler SPBluetoothDataType"
if aa contains "Bluetooth Power: Off" then
if application "System Preferences" is running then
set app_run to 1
else
set app_run to 0
View script 47.txt
-- user input
set sound_output_device to "background music"
-- end of user input
if application "System Preferences" is running then
set app_run to 1
else
set app_run to 0
end if
tell application "System Preferences"
View script 46.txt
-- user input
set network_name to "iPhone"
set apps to {"audacity", "calculator"}
-- end of user input
-- user options
set no_connection_then_quit_apps to "off" -- "on" or "off"
-- end of user options
if network_name is "" or (count apps) = 0 then
display dialog "Edit User Input in Script File." with title "Script 46"
View Linux Mint - Python Script 3.py
# user input
days = ['Mon','Tue','Wed','Thu']
# Monday = 'Mon' | Tuesday = 'Tue' | Wednesday = 'Wed' | Thursday = 'Thu' | Friday = 'Fri' | Saturday = 'Sat' | Sunday = 'Sun'
apps = ['gnome-calendar','audacity']
files_folders = ['/home/john/Desktop/abc','/usr/share/applications']
# end of user input
from datetime import datetime
import time
import os
View Linux Mint - Python Script 1.1.py
# Xdotool, Python installed
# user input
windows = ['Autokey-gtk', 'Thunderbird']
# end of user input
import time
import os
for w in windows:
searchProcess = "xdotool search --onlyvisible --class '%s'" % w
View script 45.txt
-- 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
View script 44.txt
-- 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