僕はhowm形式でメモを取り、タイトルをコメントで表示している(参考:moe | メモの方法論)。
「TODO」「借りたい本」「日付」みたいに、特定の文字列がタイトルに含まれるエントリをまとめて処理するため、コメントの文字列を検索してマークするスクリプトを作った。
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
//!*script | |
// 第一引数で指定した文字列をコメントに含むファイルをマーク | |
// e.g. *script %0Script\commentmark.js,"^TODO " | |
// 引数がなければ終了 | |
if (PPx.Arguments.Length < 1){ | |
PPx.SetPopLineMessage("引数が正しくありません。"); | |
PPx.Quit(); | |
} | |
const re = new RegExp(PPx.Arguments.Item(0), "i"); | |
for (var i = 0; i < PPx.EntryAllCount; i++) { | |
if (PPx.Entry(i).Comment.match(re)){ | |
PPx.Entry(i).Mark = 1; | |
} | |
} |
コメント行頭が「TODO 」のエントリをマークしたい場合は以下。
*script %0Script\commentmark.js,"^TODO "
コメントが「2024-10-23」といった形式のエントリをマークしたい場合は以下。
*script %0Script\commentmark.js,"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
0 件のコメント:
コメントを投稿