Skip to content

Instantly share code, notes, and snippets.

@htakeuchi
Last active June 26, 2021 22:20
Show Gist options
  • Save htakeuchi/bead77366336be9265021153023c6c48 to your computer and use it in GitHub Desktop.
Save htakeuchi/bead77366336be9265021153023c6c48 to your computer and use it in GitHub Desktop.
Bearの今日の日付のメモに追記するTextwellアクション
function zp(n) {
return ( '0' + n ).slice(-2);
}
now = new Date();
year = now.getFullYear();
month = now.getMonth() + 1;
day = now.getDate();
d = year + '/' + zp(month) + '/' + zp(day)
T( 'urlScheme', {
url: 'bear://x-callback-url/add-text?title=' + encodeURIComponent( d ) + '&tags=journal&text=' + encodeURIComponent( T.whole )
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment