Drafts用goScrapbox
code:goScrapbox.js
goScrapbox
const tag = "";
const itemList = [];
itemList.push('「どうせ記事にしきれないメモたち」の供養祭');//固定ページへの追記
itemList.push('新規');//一行目をタイトルにしてページを作る
itemList.push('日記');//その日の日記ページに追記(存在なければ新規作成)
p = Prompt.create();
p.title = "?";
for(i=0; i<itemList.length; i++) p.addButton(itemListi); p.show();
s = p.buttonPressed;
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth()+1;
const date = now.getDate();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();
text = editor.getText();
lines = text.split(/\r\n|\r|\n/);
url = homeUrl + encodeURIComponent(s) + "?body=" + encodeURIComponent(text);
}else if (s == itemList1){ title = lines0 == "" ? "無題ノート" : lines0.trim() url = homeUrl + encodeURIComponent(title) + "?body=" + encodeURIComponent(text + tag);
}else if (s == itemList2){ diaryTitle = year + "/" + month + "/" + date;
url = homeUrl + encodeURIComponent(diaryTitle) + "?body=" + encodeURIComponent(text + tag) ;
}
app.openURL(url);
editor.focus();