kitasenjudesign
#NoTags
kitasenjudesign.iconは/kinetictypoのオーナーです。
自分のことを名前で呼ぶとYazawaっぽくなる。
scriptの調べ方
CosenseのAPI
userscript
how to use userScript 👉 /help-jp/UserScript
reference /takker/scrapbox-insert-text
タグが存在してなかったらタグを自動挿入
閲覧したページのタグを収集する
code:script.js
import '/api/code/kinetictypo/タグが存在してなかったらタグを自動挿入/autotag.js';
import '/api/code/kinetictypo/閲覧したページのタグを収集する/collectTags.js';
/*タイトルをGoogleサーチする*/
scrapbox.PageMenu.addMenu({
title: 'google link',
image: 'https://gyazo.com/f5deb1e4e33a12e141798fe07b3af19b.png',
onClick: () => {
let hoge = encodeURIComponent(scrapbox.Page.title) + "";
insertText("\n🔎️️:"+scrapbox.Page.title+"\n");
}
});
export function insertText(text) {
const cursor = document.getElementById('text-input');
cursor.focus();
cursor.value = text;
const uiEvent = document.createEvent('UIEvent');
uiEvent.initEvent('input', true, false);
cursor.dispatchEvent(uiEvent);
}
/* historyバック */
scrapbox.PageMenu.addMenu({
title: 'history.back',
image: 'https://scrapbox.io/files/661c76d452e64200264217c3.png',
onClick: () => {
window.history.back();
}
});
選択を検索
/customize/選択範囲をGoogle検索するUserScript
code:script.js
scrapbox.PopupMenu.addButton({
title: 'Google Search',
onClick: text => {
// 記法を解除する
const keyword = text.split(/\n/)
.map(line => line.replace(/\(.*)\/g,'$1')).join('\n');
window.open(https://www.google.com/search?q=${encodeURIComponent(keyword)});
}
});
//chatGPTに渡す
scrapbox.PopupMenu.addButton({
title: 'chatGPTに語源きく',
onClick: text => {
// 記法を解除する
const keyword = text.split(/\n/)
.map(line => line.replace(/\(.*)\/g,'$1')).join('\n');
window.open(https://chat.openai.com/?q=${encodeURIComponent(keyword)}の語源を教えて);
}
});
moji count
code: script.js
scrapbox.PopupMenu.addButton({
title: function (text) {
const chars = text.replace(/\r\n/g, '').length
const words = text.trim().split(/\r\n\s+/).length
return ${chars}c ${words}w
},
onClick: () => null
})
img
https://gyazo.com/5df603624198ca6aca4b6501fab994fe
https://gyazo.com/94bd8610fa1fa91b4f8c01e1625ff815
https://gyazo.com/2b468c2c91b17e76e553dda25e4dd02e