text
stringlengths
0
15.7k
source
stringlengths
6
112
set the clipboard to autolink3
markdownlinks.applescript
to join(array, delimiter)
iTunes'CurrentStreamInfoToEvernote.applescript
set retVal to ""
iTunes'CurrentStreamInfoToEvernote.applescript
set prevDelimiter to AppleScript's text item delimiters
iTunes'CurrentStreamInfoToEvernote.applescript
set retVal to array as string
iTunes'CurrentStreamInfoToEvernote.applescript
set AppleScript's text item delimiters to prevDelimiter
iTunes'CurrentStreamInfoToEvernote.applescript
return retVal
iTunes'CurrentStreamInfoToEvernote.applescript
to CurrentStreamInfo()
iTunes'CurrentStreamInfoToEvernote.applescript
return {(current date) as string, current stream title, current stream URL}
iTunes'CurrentStreamInfoToEvernote.applescript
end CurrentStreamInfo
iTunes'CurrentStreamInfoToEvernote.applescript
to FindOrCreateNote()
iTunes'CurrentStreamInfoToEvernote.applescript
set notename to "iTunes Stream Information"
iTunes'CurrentStreamInfoToEvernote.applescript
set mynotes to find notes "intitle:" & notename
iTunes'CurrentStreamInfoToEvernote.applescript
if mynotes = {} then
iTunes'CurrentStreamInfoToEvernote.applescript
set mynote to create note title notename with text ""
iTunes'CurrentStreamInfoToEvernote.applescript
set mynote to item 1 of mynotes
iTunes'CurrentStreamInfoToEvernote.applescript
return mynote
iTunes'CurrentStreamInfoToEvernote.applescript
end FindOrCreateNote
iTunes'CurrentStreamInfoToEvernote.applescript
to AppendInfo(myinfo, mynote)
iTunes'CurrentStreamInfoToEvernote.applescript
append mynote html myinfo
iTunes'CurrentStreamInfoToEvernote.applescript
end AppendInfo
iTunes'CurrentStreamInfoToEvernote.applescript
AppendInfo(join(CurrentStreamInfo(), ", ") & "<br>", FindOrCreateNote())
iTunes'CurrentStreamInfoToEvernote.applescript
on run {note_name}
note_text_to_clipboard.applescript
set t_note to (find notes ("intitle:\"" & note_name & "\""))
note_text_to_clipboard.applescript
set t_note to item 1 of t_note
note_text_to_clipboard.applescript
set note_win to open note window with t_note
note_text_to_clipboard.applescript
activate note_win
note_text_to_clipboard.applescript
key code 48
note_text_to_clipboard.applescript
close note_win
note_text_to_clipboard.applescript
set myAlien to {name:"Largon", type:"Gruub", language:"Borbulian", sex:"Only with Gruubs"}
010_02_lists_and_records-associative_arrays.applescript
set thisName to name of myAlien
010_02_lists_and_records-associative_arrays.applescript
set sex of myAlien to "No Thankyou"
010_02_lists_and_records-associative_arrays.applescript
set myLength to count of myAlien
010_02_lists_and_records-associative_arrays.applescript
property defaultAccountName : "iCloud"
Save Safari Tabs to Notes.applescript
property defaultFolderName : "Saved Safari Windows"
Save Safari Tabs to Notes.applescript
global html
Save Safari Tabs to Notes.applescript
global processedURLs
Save Safari Tabs to Notes.applescript
on appendLineWithDoc(theDoc)
Save Safari Tabs to Notes.applescript
tell theDoc
Save Safari Tabs to Notes.applescript
my appendHTML(" <li>")
Save Safari Tabs to Notes.applescript
my appendHTML("<a href=\"" & URL & "\">")
Save Safari Tabs to Notes.applescript
my appendHTML(name)
Save Safari Tabs to Notes.applescript
my appendHTML("</a></li>" & return)
Save Safari Tabs to Notes.applescript
set processedURLs to processedURLs & (URL as string)
Save Safari Tabs to Notes.applescript
end appendLineWithDoc
Save Safari Tabs to Notes.applescript
on appendHTML(htmlString)
Save Safari Tabs to Notes.applescript
set html to html & htmlString
Save Safari Tabs to Notes.applescript
end appendHTML
Save Safari Tabs to Notes.applescript
on defaultFolder()
Save Safari Tabs to Notes.applescript
if not (exists account defaultAccountName) then
Save Safari Tabs to Notes.applescript
display dialog "Cound not find account '" & defaultAccountName & "'!"
Save Safari Tabs to Notes.applescript
if exists folder defaultFolderName of account defaultAccountName then
Save Safari Tabs to Notes.applescript
return folder defaultFolderName of account defaultAccountName
Save Safari Tabs to Notes.applescript
make new folder at account defaultAccountName with properties {name:defaultFolderName}
Save Safari Tabs to Notes.applescript
end defaultFolder
Save Safari Tabs to Notes.applescript
set datestamp to "Saved on " & (short date string) of (current date) & " at " & (time string) of (current date) & return
Save Safari Tabs to Notes.applescript
set html to "<h1>" & datestamp & "</h1>" & return
Save Safari Tabs to Notes.applescript
my appendHTML("<ul>" & return)
Save Safari Tabs to Notes.applescript
set processedURLs to {}
Save Safari Tabs to Notes.applescript
set w to window 1
Save Safari Tabs to Notes.applescript
try -- this will fail for the downloads window
Save Safari Tabs to Notes.applescript
set n to count tabs of w
Save Safari Tabs to Notes.applescript
if n > 1 then
Save Safari Tabs to Notes.applescript
repeat with t in every tab of w
Save Safari Tabs to Notes.applescript
my appendLineWithDoc(t)
Save Safari Tabs to Notes.applescript
else if n = 1 then
Save Safari Tabs to Notes.applescript
my appendLineWithDoc(document of w)
Save Safari Tabs to Notes.applescript
my appendHTML("</ul>" & return)
Save Safari Tabs to Notes.applescript
if (count of processedURLs) > 0 then
Save Safari Tabs to Notes.applescript
set f to my defaultFolder()
Save Safari Tabs to Notes.applescript
make new note at f with properties {body:html, name:datestamp}
Save Safari Tabs to Notes.applescript
set defaultBrowser to do shell script "defaults read \\
thingiverse zip download.applescript
~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure \\
thingiverse zip download.applescript
| awk -F'\"' '/http;/{print window[(NR)-1]}{window[NR]=$2}'"
thingiverse zip download.applescript
if defaultBrowser is "" or defaultBrowser contains "safari" then
thingiverse zip download.applescript
set defaultBrowser to "Safari"
thingiverse zip download.applescript
else if defaultBrowser contains "chrome" then
thingiverse zip download.applescript
set defaultBrowser to "Google Chrome"
thingiverse zip download.applescript
else if defaultBrowser contains "firefox" then
thingiverse zip download.applescript
set defaultBrowser to "Firefox"
thingiverse zip download.applescript
set defaultBrowser to "Other"
thingiverse zip download.applescript
if defaultBrowser = "Google Chrome" then
thingiverse zip download.applescript
else if defaultBrowser = "Safari" then
thingiverse zip download.applescript
set theURL to URL of current tab of window 1
thingiverse zip download.applescript
else if defaultBrowser = "firefox" then
thingiverse zip download.applescript
set theURL to the clipboard
thingiverse zip download.applescript
if theURL does not contain "thingiverse.com" then
thingiverse zip download.applescript
display dialog "This doesn't look like a Thingiverse Download Request, exiting now!" giving up after 2
thingiverse zip download.applescript
set newURL to {""}
thingiverse zip download.applescript
if theURL contains "thingiverse.com/thing:" then
thingiverse zip download.applescript
set lastWord to last word of theURL as string
thingiverse zip download.applescript
if lastWord is not "files" and lastWord is not "comments" and lastWord is not "makes" and lastWord is not "remixes" and lastWord is not "apps" then
thingiverse zip download.applescript
set end of newURL to theURL & "/zip"
thingiverse zip download.applescript
set newURL to {"http://"}
thingiverse zip download.applescript
repeat with i in words of theURL
thingiverse zip download.applescript
if i contains "http" then
thingiverse zip download.applescript
set newURL to newURL
thingiverse zip download.applescript
if i contains "thing" and i does not contain "thingiverse" then
thingiverse zip download.applescript
set end of newURL to i & ":" as string
thingiverse zip download.applescript
else if i contains "files" or i contains "comments" or i contains "makes" or i contains "remixes" or i contains "apps" then
thingiverse zip download.applescript