text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
if theOffset is greater than -50 then set base64Detect to true
|
AppleMailToEvernote.scpt
|
return base64Detect
|
AppleMailToEvernote.scpt
|
end base64_Check
|
AppleMailToEvernote.scpt
|
on base64_Decode(mySource)
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "Content-Type: text/html"
|
AppleMailToEvernote.scpt
|
set base64_Raw to second text item of mySource
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to linefeed & linefeed
|
AppleMailToEvernote.scpt
|
set base64_Raw to second text item of base64_Raw
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "-----"
|
AppleMailToEvernote.scpt
|
set multiHTML to first text item of base64_Raw
|
AppleMailToEvernote.scpt
|
set baseHTML to do shell script "echo " & (quoted form of multiHTML) & "| base64 -D"
|
AppleMailToEvernote.scpt
|
return baseHTML
|
AppleMailToEvernote.scpt
|
end base64_Decode
|
AppleMailToEvernote.scpt
|
on htmlFix(multiHTML, theBoundary, myContent)
|
AppleMailToEvernote.scpt
|
set paraSource to paragraphs of multiHTML
|
AppleMailToEvernote.scpt
|
if item 1 of paraSource contains "Received:" then
|
AppleMailToEvernote.scpt
|
set myHeaderlines to (item 1 of paraSource)
|
AppleMailToEvernote.scpt
|
set multiHTML to my stripHeader(paraSource, myHeaderlines)
|
AppleMailToEvernote.scpt
|
if multiHTML contains "</html>" then
|
AppleMailToEvernote.scpt
|
set multiHTML to my extractBetween(multiHTML, "Content-Type: text/html", "</html>")
|
AppleMailToEvernote.scpt
|
set multiHTML to my extractBetween(multiHTML, "Content-Type: text/html", "--" & theBoundary)
|
AppleMailToEvernote.scpt
|
if item 1 of paraSource contains ";" then
|
AppleMailToEvernote.scpt
|
if item 1 of paraSource is "" then
|
AppleMailToEvernote.scpt
|
if item 2 of paraSource contains "Content-Transfer-Encoding" then
|
AppleMailToEvernote.scpt
|
set myHeaderlines to (item 2 of paraSource)
|
AppleMailToEvernote.scpt
|
if item 2 of paraSource contains "charset" then
|
AppleMailToEvernote.scpt
|
if item 1 of paraSource contains "Content-Transfer-Encoding" then
|
AppleMailToEvernote.scpt
|
if item 1 of paraSource contains "charset" then
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to theBoundary
|
AppleMailToEvernote.scpt
|
set theSourceItems to text items of multiHTML
|
AppleMailToEvernote.scpt
|
set theEncoded to theSourceItems as text
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "%"
|
AppleMailToEvernote.scpt
|
set theSourceItems to text items of theEncoded
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "&#" & "37;" as string
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "%\""
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "=\""
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "%" & (ASCII character 13)
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "%%"
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "%" & (ASCII character 10)
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "%0A"
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "%09"
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "%C2%A0"
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to " "
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "&#" & "61;" as string
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "&#" & "36;" as string
|
AppleMailToEvernote.scpt
|
set AppleScript's text item delimiters to "'"
|
AppleMailToEvernote.scpt
|
set trimHTML to my extractBetween(theEncoded, "</head>", "</html>")
|
AppleMailToEvernote.scpt
|
set theHTML to myContent
|
AppleMailToEvernote.scpt
|
set decode_Success to false
|
AppleMailToEvernote.scpt
|
set NewEncodedText to do shell script "echo " & quoted form of trimHTML & " | iconv -t UTF-8 "
|
AppleMailToEvernote.scpt
|
set the_UTF8Text to quoted form of NewEncodedText
|
AppleMailToEvernote.scpt
|
set theDecodeScript to "php -r \"echo utf8_encode(urldecode(utf8_decode(" & the_UTF8Text & ")));\"" as text
|
AppleMailToEvernote.scpt
|
set theDecoded to do shell script theDecodeScript
|
AppleMailToEvernote.scpt
|
set theSourceItems to text items of theDecoded
|
AppleMailToEvernote.scpt
|
set theDecoded to theSourceItems as text
|
AppleMailToEvernote.scpt
|
set finalHTML to theDecoded
|
AppleMailToEvernote.scpt
|
set decode_Success to true
|
AppleMailToEvernote.scpt
|
return finalHTML
|
AppleMailToEvernote.scpt
|
end htmlFix
|
AppleMailToEvernote.scpt
|
on process_Items(itemNum, attNum)
|
AppleMailToEvernote.scpt
|
set attPlural to ""
|
AppleMailToEvernote.scpt
|
if attNum = 0 then
|
AppleMailToEvernote.scpt
|
set attNum to "No"
|
AppleMailToEvernote.scpt
|
else if attNum > 1 then
|
AppleMailToEvernote.scpt
|
set attPlural to "s"
|
AppleMailToEvernote.scpt
|
if growl_Running is true then
|
AppleMailToEvernote.scpt
|
set Plural_Test to (itemNum) as number
|
AppleMailToEvernote.scpt
|
if Plural_Test is greater than 1 then
|
AppleMailToEvernote.scpt
|
"Import To Evernote" title ¬
|
AppleMailToEvernote.scpt
|
"Import To Evernote Started" description "Now Processing " & itemNum & " Items with " & attNum & ¬
|
AppleMailToEvernote.scpt
|
" attachment" & attPlural & "." application name ¬
|
AppleMailToEvernote.scpt
|
"Apple Mail to Evernote" icon of application "Mail"
|
AppleMailToEvernote.scpt
|
"Import To Evernote Started" description "Now Processing " & itemNum & " Item With " & attNum & ¬
|
AppleMailToEvernote.scpt
|
" Attachment" & attPlural & "." application name ¬
|
AppleMailToEvernote.scpt
|
end tell --FINDER
|
AppleMailToEvernote.scpt
|
end process_Items
|
AppleMailToEvernote.scpt
|
on notifier(successCount, errNum)
|
AppleMailToEvernote.scpt
|
if errNum is -128 then display notification ¬
|
AppleMailToEvernote.scpt
|
"No Items Selected In Apple Mail!" with title ¬
|
AppleMailToEvernote.scpt
|
"No Items Exported From Mail!" with title ¬
|
AppleMailToEvernote.scpt
|
"Successfully Exported " & itemNum & ¬
|
AppleMailToEvernote.scpt
|
" Item to the " & EVnotebook & ¬
|
AppleMailToEvernote.scpt
|
" Notebook in Evernote" with title ¬
|
AppleMailToEvernote.scpt
|
"Apple Mail to Evernote" subtitle "Import Success"
|
AppleMailToEvernote.scpt
|
" Items to the " & EVnotebook & ¬
|
AppleMailToEvernote.scpt
|
end notifier
|
AppleMailToEvernote.scpt
|
set statusOld to checkStatus()
|
internalmic.scpt
|
set statusNew to checkStatus()
|
internalmic.scpt
|
repeat while statusOld is equal to statusNew
|
internalmic.scpt
|
delay 1 --for 1 second checks
|
internalmic.scpt
|
if statusNew is true then
|
internalmic.scpt
|
display dialog "Device Added - put some real code here"
|
internalmic.scpt
|
display dialog "Device Removed - put some real code here"
|
internalmic.scpt
|
on checkStatus()
|
internalmic.scpt
|
set myString to button returned of (display dialog "Connected?" buttons {"Yes", "No"})
|
internalmic.scpt
|
set myString to "name: DR-BT101 Connected: " & myString
|
internalmic.scpt
|
if myString does not contain "DR-BT101" then
|
internalmic.scpt
|
set AppleScript's text item delimiters to "name:"
|
internalmic.scpt
|
set myList to the text items of myString --each item of mylist is now one of the devices
|
internalmic.scpt
|
set numberOfDevices to count of myList
|
internalmic.scpt
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.