選択したEvernoteのノートの背景色を変更するAppleScript
code:applescript.scpt
tell application "Evernote"
set a to selection
set b to item 1 of a
set c to HTML content of b
set d to my regexReplace(c, "<div id=\"en-note\">", "<div id=\"en-note\" style=\"background-color:coral;\">")
set HTML content of b to d
end tell
use framework "Foundation"
on regexReplace(aText as text, pattern as text, replacement as text)
--require framework: Foundation
set regularExpression to current application's NSRegularExpression's regularExpressionWithPattern:pattern options:0 |error|:(missing value)
return (regularExpression's stringByReplacingMatchesInString:aText options:0 range:{location:0, |length|:count aText} withTemplate:replacement) as text
end regexReplace
coralのところを書き換えたら、好きな色にできます。
ダイアログで色指定を受けとるとかもできるでしょう。
選択したEvernoteのノートの背景色を変更するAppleScript