- TextExpanderに「Content: アップルスクリプト」として登録
- Safariで引用部分を選択しておき、テキストエディタ上でAbbreviationを入力して実行
- HTMLタグを含めて引用するのが特徴
- リンクを反映できる
- Thanks: Happy-Go-Lucky: Webページを HTML のまま引用するブックマークレット
blockquote.scpt
tell application "Safari"
tell current tab of window 1
do JavaScript "var htmlText = '';
if (document.selection) {
var c = document.selection.createRange();
htmlText = c.htmlText;
} else {
var nNd = document.createElement(\"div\");
var sel = getSelection();
if (sel == null || sel == '') {
htmlText = '';
} else {
var w = getSelection().getRangeAt(0).cloneContents();
nNd.appendChild(w);
htmlText = nNd.innerHTML;
}
}
'<blockquote cite=\"' + location.href + '\" title=\"' + document.title + '\">\\n' + htmlText + '\\n' + '<cite><a href=\"' + location.href + '\" target=\"_blank\">' + document.title + '</a></cite>\\n' + '</blockquote>\\n';"
end tell
end tell
更新履歴
- 2012-10-31: Google Chrome版として作成
- 2015-12-25: Safari版に修正