Skip to content

Instantly share code, notes, and snippets.

View my key 83.1.txt
<?xml version="1.0"?>
<root>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_83</name>
<url type="shell">
osascript -e '
set sName to "83"
tell application "System Events"
View script 4.txt
-- user input
set des1 to "" -- ex. "/Volumes/Data/A/folder"
set ext to {"mkv", "mp4", "avi", "vob"}
-- end of user input
set des1p to POSIX file des1
tell application "Finder"
open des1p
activate
delay 0.3
end tell
View script 5.txt
-- user input
set textFile to "" -- ex. "/Volumes/Data/A/file.txt"
set des1 to "" -- ex. "/Volumes/Data/A/folder"
-- end of user input
set textFilep to POSIX file textFile
set textFileRead to paragraphs of (read of textFilep)
set des1p to POSIX file des1
tell application "Finder"
open des1p
activate
View script 6.txt
tell application "Google Chrome"
activate
delay 0.3
set a to get title of front window
try
set AppleScript's text item delimiters to {"- "}
set siteName to last text item of a
end try
end tell
tell application "System Events"
View my key 83.2.txt
<?xml version="1.0"?>
<root>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_83</name>
<url type="shell">
osascript -e '
set sName to "83"
tell application "System Events"
View script 7.txt
-- user input
set Output to {"item1", "item2"}
set Input to {"item1", "item2"}
-- end of user input
set userList to {"(( OUTPUT ))"}
repeat with i from 1 to count Output
set itemPre to item i of Output & " ."
delay 0.02
copy itemPre to the end of userList
end repeat
View script 8.txt
-- clean copied link
delay 0.5
set copT to the clipboard
-- google.
if copT contains "google." then
try
set AppleScript's text item delimiters to {"url="}
set Clean1 to text item 2 of copT
set AppleScript's text item delimiters to {"&usg="}
set Clean2 to text item 1 of Clean1
View script 9.txt
-- user options
set mNumber to "" -- "show" or ""
set mBlankLine to "" -- "show" or ""
-- end of user options
try
delay 0.5
set copT to the clipboard
set AppleScript's text item delimiters to {return}
set aList to every text item of copT
set a2List to {}
View script 8.1.txt
-- clean copied link
delay 0.5
set copT to the clipboard
-- google.
if copT contains "google." then
try
set AppleScript's text item delimiters to {"url="}
set Clean1 to text item 2 of copT
set AppleScript's text item delimiters to {"&usg="}
set Clean2 to text item 1 of Clean1
View script 10.txt
try
tell application "Firefox"
activate
end tell
delay 1
tell application "System Events"
set activeApp to (get name of first process where it is frontmost)
repeat 300 times
tell application "Firefox"
activate