Last active
August 29, 2015 14:05
-
-
Save Pafuxu/87da9f56207cc48da141 to your computer and use it in GitHub Desktop.
引用タグを自動化する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Safari" | |
activate | |
set theURL to URL of front document | |
set theTitle to name of front document | |
set selectedText to (do JavaScript "(''+getSelection())" in document 1) | |
set the clipboard to "<blockquote class=\"block-quote_content\" cite=\"" & theURL & "\" title=\"「" & theTitle & "」から引用\">" & return & " " & "<p>" & selectedText & "</p>" & return & " " & "<footer>" & return & " " & "<cite>— <a href=\"" & theURL & "\">" & theTitle & "</cite>" & return & " " & "</footer>" & return & "</blockquote>" & return as string | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Safari" | |
activate | |
set theURL to URL of front document | |
set theTitle to name of front document | |
set selectedText to (do JavaScript "(''+getSelection())" in document 1) | |
set the clipboard to "<q class=\"inline-quote_content\" cite=\"" & theURL & "\" title=\"「" & theTitle & "」から引用\">" & selectedText & "</q>" as string | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment