text
stringlengths
0
15.7k
source
stringlengths
6
112
set the_Selection to selection
send_to_marsedit.scpt
set the_Title to title of (item 1 of the_Selection)
send_to_marsedit.scpt
set the_HTML to HTML content of (item 1 of the_Selection)
send_to_marsedit.scpt
set the_Text to do shell script "echo " & quoted form of the_HTML & space & "| textutil -convert txt -stdin -stdout"
send_to_marsedit.scpt
set the_Tags to {}
send_to_marsedit.scpt
set tag_list to tags of (item 1 of the_Selection)
send_to_marsedit.scpt
repeat with a_tag in tag_list
send_to_marsedit.scpt
set the_Tags to the_Tags & (name of a_tag)
send_to_marsedit.scpt
set the_Tags to the_Tags as text
send_to_marsedit.scpt
set title to the_Title
send_to_marsedit.scpt
set body to the_Text
send_to_marsedit.scpt
set tags to the_Tags
send_to_marsedit.scpt
set text filter to "Markdown"
send_to_marsedit.scpt
tell application "Atom"
003_02_commands.applescript
set today to ((current date) as string)
auto-server-mount.scpt
set ping_result to (do shell script "ping -c 1 SHODAN.local")
auto-server-mount.scpt
if ping_result contains "bytes from" then
auto-server-mount.scpt
tell application "System Events" to set my_disks to name of every disk
auto-server-mount.scpt
if "WORK" is in my_disks then
auto-server-mount.scpt
return today & " - SHODAN is already mounted"
auto-server-mount.scpt
mount volume "WORK" on server "shodan"
auto-server-mount.scpt
mount volume "BACKUP" on server "shodan"
auto-server-mount.scpt
mount volume "XFR" on server "shodan"
auto-server-mount.scpt
mount volume "REPOSITORY" on server "shodan"
auto-server-mount.scpt
return today & " - SHODAN found and mounted"
auto-server-mount.scpt
return today & " - SHODAN not online"
auto-server-mount.scpt
return today & " - network error: " & errmsg
auto-server-mount.scpt
set the clipboard to (the clipboard as text)
ReFormTheClipboard.applescript
set_string_variable "ffCloseOrder" to my replaceLastInstanceOfChar(ffCloseOrder, "w", "")
firefox-dev-cmd-shift-n.applescript
to lastIndexOfChar(haystack, needle) # case insensitive
firefox-dev-cmd-shift-n.applescript
set ray to text items of haystack
firefox-dev-cmd-shift-n.applescript
set charCount to count of ray
firefox-dev-cmd-shift-n.applescript
set i to charCount
firefox-dev-cmd-shift-n.applescript
repeat charCount times
firefox-dev-cmd-shift-n.applescript
set cur_char to text item i of ray
firefox-dev-cmd-shift-n.applescript
if (cur_char is equal to needle) then exit repeat
firefox-dev-cmd-shift-n.applescript
end lastIndexOfChar
firefox-dev-cmd-shift-n.applescript
to replaceLastInstanceOfChar(haystack, needle, replaceWith)
firefox-dev-cmd-shift-n.applescript
set i to lastIndexOfChar(haystack, needle)
firefox-dev-cmd-shift-n.applescript
set charCount to count of haystack
firefox-dev-cmd-shift-n.applescript
if (i is equal to 0) then return haystack
firefox-dev-cmd-shift-n.applescript
if (i is equal to 1 and charCount is equal to 1) then return replaceWith
firefox-dev-cmd-shift-n.applescript
if (i is equal to 1) then return replaceWith & text (text item (i + 1)) thru (text item (-1)) of haystack # last instance = char 0
firefox-dev-cmd-shift-n.applescript
if (i is equal to charCount) then return text (text item 1) thru (text item (i - 1)) of haystack & replaceWith # last instance = last char
firefox-dev-cmd-shift-n.applescript
return text (text item 1) thru (text item (i - 1)) of haystack & replaceWith & text (text item (i + 1)) thru (text item (-1)) of haystack # last instance in the middle
firefox-dev-cmd-shift-n.applescript
end replaceLastInstanceOfChar
firefox-dev-cmd-shift-n.applescript
on run {note_name, notebook_name, html_path}
note_export_html_with_nbname.applescript
run script (POSIX file "/Users/IceHe/Documents/AppleScript/Evernote/evernote_launch.applescript")
note_export_html_with_nbname.applescript
set note_found to find notes "notebook:\"" & notebook_name & "\" intitle:\"" & note_name & "\""
note_export_html_with_nbname.applescript
if 1 = (count of note_found) then
note_export_html_with_nbname.applescript
export note_found to (POSIX file html_path) format HTML
note_export_html_with_nbname.applescript
log uuid()
uuid.applescript
on uuid()
uuid.applescript
set buffer to ""
uuid.applescript
set chars to "0123456789ABCDEF"
uuid.applescript
set charCount to length of chars
uuid.applescript
repeat with i from 1 to 36
uuid.applescript
if i is in {9, 14, 19, 24} then
uuid.applescript
set buffer to buffer & "-"
uuid.applescript
else if i is 15 then
uuid.applescript
set buffer to buffer & "4"
uuid.applescript
else if i is 20 then
uuid.applescript
set buffer to buffer & character (random number from 1 to 4) of "89AB"
uuid.applescript
set buffer to buffer & character (random number from 1 to charCount) of chars
uuid.applescript
return buffer
uuid.applescript
end uuid
uuid.applescript
set homePath to (POSIX path of (path to home folder))
fm_import_field_recording.applescript
set stimulusPath to homePath & "Desktop/stimulus.wav"
fm_import_field_recording.applescript
set recordingPath to homePath & "Desktop/measurement.wav"
fm_import_field_recording.applescript
if application "FuzzMeasure" is not running then
fm_import_field_recording.applescript
tell application "FuzzMeasure" to activate
fm_import_field_recording.applescript
tell application "FuzzMeasure"
fm_import_field_recording.applescript
tell first document
fm_import_field_recording.applescript
set fieldRecording to import field recording named recordingPath recorded with stimulus signal stimulusPath
fm_import_field_recording.applescript
set theMeasurement to item 1 of fieldRecording
fm_import_field_recording.applescript
on minimizeBrowser()
minimize_browser.scpt
tell application "Google Chrome" to set theBrowser to window 1
minimize_browser.scpt
if (minimized of theBrowser) is false then set minimized of theBrowser to true
minimize_browser.scpt
end minimizeBrowser
minimize_browser.scpt
my minimizeBrowser()
minimize_browser.scpt
on run {flag}
reset_flag.applescript
set is_set to run script (POSIX file "/Users/IceHe/Documents/AppleScript/Lib/get_flag.applescript") with parameters {flag as string}
reset_flag.applescript
if is_set = false then
reset_flag.applescript
do shell script ("rmdir /Users/IceHe/Documents/Registry/Flag/" & flag)
reset_flag.applescript
set is_set to run script (POSIX file "/Users/IceHe/Documents/AppleScript/Lib/get_flag.applescript") with parameters {flag}
reset_flag.applescript
if is_set then
reset_flag.applescript
set exampleString to "ABC"
convertToLowerCase.applescript
return convertToLowerCase(exampleString)
convertToLowerCase.applescript
on convertToLowerCase(theString)
convertToLowerCase.applescript
set UPPERCASE to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
convertToLowerCase.applescript
set lowercase to "abcdefghijklmnopqrstuvwxyz"
convertToLowerCase.applescript
set theWords to text items of theString as list
convertToLowerCase.applescript
repeat with theWord in theWords
convertToLowerCase.applescript
set chrs to characters of theWord
convertToLowerCase.applescript
set Nchrs to count chrs -- get the number of characters
convertToLowerCase.applescript
repeat with K from 1 to Nchrs
convertToLowerCase.applescript
if (item K of chrs) is in lowercase then
convertToLowerCase.applescript
set olc to offset of (item K of chrs) in UPPERCASE
convertToLowerCase.applescript
set item K of chrs to character olc of lowercase
convertToLowerCase.applescript
set end of newList to chrs as string
convertToLowerCase.applescript