Skip to content

Instantly share code, notes, and snippets.

<?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"
-- 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
-- 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
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"
<?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"
-- 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
-- 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
-- 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 {}
-- 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
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