text
stringlengths
0
15.7k
source
stringlengths
6
112
set result to result & "-"
Evernote2AppleNotes.scpt
set result to result & zero_pad(month of now as integer, 2)
Evernote2AppleNotes.scpt
set result to result & zero_pad(day of now as integer, 2)
Evernote2AppleNotes.scpt
set result to result & "T"
Evernote2AppleNotes.scpt
set result to result & zero_pad(hours of now as integer, 2)
Evernote2AppleNotes.scpt
set result to result & ":"
Evernote2AppleNotes.scpt
set result to result & zero_pad(minutes of now as integer, 2)
Evernote2AppleNotes.scpt
set result to result & zero_pad(seconds of now as integer, 2)
Evernote2AppleNotes.scpt
return result
Evernote2AppleNotes.scpt
end nowYYYYMMDDMMSS
Evernote2AppleNotes.scpt
on zero_pad(value, string_length)
Evernote2AppleNotes.scpt
set string_zeroes to ""
Evernote2AppleNotes.scpt
set digits_to_pad to string_length - (length of (value as string))
Evernote2AppleNotes.scpt
if digits_to_pad > 0 then
Evernote2AppleNotes.scpt
repeat digits_to_pad times
Evernote2AppleNotes.scpt
set string_zeroes to string_zeroes & "0" as string
Evernote2AppleNotes.scpt
set padded_value to string_zeroes & value as string
Evernote2AppleNotes.scpt
return padded_value
Evernote2AppleNotes.scpt
end zero_pad
Evernote2AppleNotes.scpt
on writeToFile(this_data, target_file, append_data) -- (string, file path as string, boolean)
Evernote2AppleNotes.scpt
set the target_file to the target_file as string
Evernote2AppleNotes.scpt
set the open_target_file to open for access file target_file with write permission
Evernote2AppleNotes.scpt
if append_data is false then set eof of the open_target_file to 0
Evernote2AppleNotes.scpt
write this_data to the open_target_file starting at eof
Evernote2AppleNotes.scpt
log "ERROR" & errStr & errorNumber
Evernote2AppleNotes.scpt
close access file target_file
Evernote2AppleNotes.scpt
on readFile(theFile)
Evernote2AppleNotes.scpt
set theFile to theFile as string
Evernote2AppleNotes.scpt
return read file theFile
Evernote2AppleNotes.scpt
end readFile
Evernote2AppleNotes.scpt
on getNoteContentFromEvernoteNote(evernoteNote)
Evernote2AppleNotes.scpt
set noteContent to HTML content of evernoteNote
Evernote2AppleNotes.scpt
set allAttachments to every attachment in evernoteNote
Evernote2AppleNotes.scpt
if (allAttachments is not {}) then
Evernote2AppleNotes.scpt
tell application "System Events" to if (exists file tmpNoteContentPath) then delete file tmpNoteContentPath
Evernote2AppleNotes.scpt
my writeToFile(noteContent, tmpNoteContentPath, false)
Evernote2AppleNotes.scpt
repeat with currentAttachment in allAttachments
Evernote2AppleNotes.scpt
set attachmentHash to hash of currentAttachment
Evernote2AppleNotes.scpt
set attachmentMime to mime of currentAttachment
Evernote2AppleNotes.scpt
if attachmentMime contains "image" then
Evernote2AppleNotes.scpt
tell application "System Events" to if (exists file tmpAttachmentFilePath) then delete file tmpAttachmentFilePath
Evernote2AppleNotes.scpt
currentAttachment write to tmpAttachmentFilePath
Evernote2AppleNotes.scpt
do shell script "openssl base64 -in " & quoted form of POSIX path of tmpAttachmentFilePath & " > " & quoted form of POSIX path of tmpAttachmentB64FilePath
Evernote2AppleNotes.scpt
set prependReplace to "<img style=\"max-width: 100%; max-height: 100%;\" src=\"data:" & attachmentMime & ";base64,"
Evernote2AppleNotes.scpt
do shell script "cat " & quoted form of POSIX path of tmpAttachmentB64FilePath & " | pbcopy && echo '" & prependReplace & "' > " & quoted form of POSIX path of tmpAttachmentB64FilePath & " && pbpaste >> " & quoted form of POSIX path of tmpAttachmentB64FilePath
Evernote2AppleNotes.scpt
do shell script "echo '\"/>' >> " & quoted form of POSIX path of tmpAttachmentB64FilePath
Evernote2AppleNotes.scpt
set searchPattern to "<img[^>]*" & attachmentHash & ".*?>"
Evernote2AppleNotes.scpt
do shell script "cat " & (quoted form of POSIX path of tmpNoteContentPath) & " | perl -pe 's|" & searchPattern & "|`cat " & quoted form of POSIX path of tmpAttachmentB64FilePath & "`|gme' | pbcopy && pbpaste > " & (quoted form of POSIX path of tmpNoteContentPath)
Evernote2AppleNotes.scpt
if showAttachmentError is true then
Evernote2AppleNotes.scpt
set dialogText to "The note (" & title of evernoteNote & ") has unhandled attachment mime-type: " & attachmentMime & ". Attachment will NOT be imported. Set property showAttachmentError to false to ignore such messages."
Evernote2AppleNotes.scpt
display dialog dialogText
Evernote2AppleNotes.scpt
set noteContent to my readFile(tmpNoteContentPath)
Evernote2AppleNotes.scpt
return noteContent
Evernote2AppleNotes.scpt
end getNoteContentFromEvernoteNote
Evernote2AppleNotes.scpt
on cleanup()
Evernote2AppleNotes.scpt
if (exists file tmpNoteContentPath) then delete file tmpNoteContentPath
Evernote2AppleNotes.scpt
if (exists file tmpAttachmentFilePath) then delete file tmpAttachmentFilePath
Evernote2AppleNotes.scpt
if (exists file tmpAttachmentB64FilePath) then delete file tmpAttachmentB64FilePath
Evernote2AppleNotes.scpt
do shell script "echo " & quoted form of clipboardContent & " | pbcopy"
Evernote2AppleNotes.scpt
end cleanup
Evernote2AppleNotes.scpt
set MacOSVers to do shell script "defaults read /System/Library/CoreServices/SystemVersion.plist ProductVersion"
GetSysInfoMojave.scpt
set MacOSBuild to do shell script "defaults read /System/Library/CoreServices/SystemVersion.plist ProductBuildVersion"
GetSysInfoMojave.scpt
set XProtectVers to do shell script "defaults read /System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.meta.plist Version"
GetSysInfoMojave.scpt
set XProtectDate to do shell script "GetFileInfo -d /System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.meta.plist"
GetSysInfoMojave.scpt
set GatekeeperVers to do shell script "defaults read /private/var/db/gkopaque.bundle/Contents/version.plist CFBundleShortVersionString"
GetSysInfoMojave.scpt
set GatekeeperDate to do shell script "GetFileInfo -d /private/var/db/gkopaque.bundle/Contents/version.plist"
GetSysInfoMojave.scpt
set SIPVer to do shell script "defaults read /System/Library/Sandbox/Compatibility.bundle/Contents/version.plist CFBundleShortVersionString"
GetSysInfoMojave.scpt
set SIPDateShort to do shell script "GetFileInfo -d /System/Library/Sandbox/Compatibility.bundle/Contents/version.plist"
GetSysInfoMojave.scpt
set MRTVer to do shell script "defaults read /System/Library/CoreServices/MRT.app/Contents/version.plist CFBundleShortVersionString"
GetSysInfoMojave.scpt
set MRTDate to do shell script "GetFileInfo -d /System/Library/CoreServices/MRT.app/Contents/version.plist"
GetSysInfoMojave.scpt
set SIPStatus to do shell script "/usr/bin/csrutil status"
GetSysInfoMojave.scpt
set GatekeeperStatus to do shell script "spctl --status | sed -e s/'assessments'//g"
GetSysInfoMojave.scpt
display dialog tab & tab & tab & "MacOS " & MacOSVers & " (" & MacOSBuild & ")" & return & return & "Component " & tab & tab & "Version " & tab & tab & "Updated " & return & return & "XProtect " & tab & tab & XProtectVers & tab & tab & XProtectDate & return & "Gatekeeper " & tab & tab & GatekeeperVers & tab & tab & tab & GatekeeperDate & return & "SIP" & tab & tab & tab & tab & SIPVer & tab & tab & tab & SIPDateShort & return & "MRT " & tab & tab & tab & MRTVer & tab & tab & tab & MRTDate & return & return & SIPStatus & return & "Gatekeeper Status:" & GatekeeperStatus & return buttons {"Close"} default button 1
GetSysInfoMojave.scpt
set work to ["WorkAccount1", "WorkAccount2"]
accounts service.applescript
set private to ["PrivateAccount1", "PrivateAccount2", "PrivateAccount3"]
accounts service.applescript
set otherAccounts to ["OtherAccount1", "OtherAccount2", "OtherAccount3"]
accounts service.applescript
(choose from list {"work", "private", "other"} default items "work" OK button name "Ok" with prompt "Choose account type" with title "Enable disable account group" with multiple selections allowed)
accounts service.applescript
set accountTypes to result
accounts service.applescript
if accountTypes is false then return
accounts service.applescript
(choose from list {"enable", "disable"} default items "enable" OK button name "Ok" with prompt "Enable or disable" with title "Create Reminder from E-Mail")
accounts service.applescript
set myBool to result
accounts service.applescript
if myBool is false then
accounts service.applescript
else if myBool as rich text is "enable" then
accounts service.applescript
set myBool to true
accounts service.applescript
else if myBool as rich text is "disable" then
accounts service.applescript
set myBool to false
accounts service.applescript
repeat with accountType in accountTypes
accounts service.applescript
if accountType as rich text is "work" then
accounts service.applescript
repeat with name in work
accounts service.applescript
set enabled of account name to myBool
accounts service.applescript
else if accountType as rich text is "private" then
accounts service.applescript
repeat with name in private
accounts service.applescript
else if accountType as rich text is "other" then
accounts service.applescript
repeat with name in otherAccounts
accounts service.applescript
system attribute "USER_HOME"
system attribute "USER_HOME".applescript
property btnTitle : "Mute audio"
zoomMuteState.1s.scpt
if application "zoom.us" is running then
zoomMuteState.1s.scpt
tell application process "zoom.us"
zoomMuteState.1s.scpt
if exists (menu bar item "Meeting" of menu bar 1) then
zoomMuteState.1s.scpt
if exists (menu item btnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then
zoomMuteState.1s.scpt