Skip to content

Instantly share code, notes, and snippets.

@tkrkt
Last active May 17, 2019 06:53
Show Gist options
  • Save tkrkt/9b46503cc2111ef9f19b7f1922b39f81 to your computer and use it in GitHub Desktop.
Save tkrkt/9b46503cc2111ef9f19b7f1922b39f81 to your computer and use it in GitHub Desktop.
[Alfred] [Bear] append tweet to bear
// with input as query
function run() {
const id = "<note-id>";
const app = Application.currentApplication();
app.includeStandardAdditions = true;
const d = new Date();
const time = `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()} ${d.getHours()}:${d.getMinutes()}`;
const text = `{query}\n${time}\n----`;
const url = `bear://x-callback-url/add-text?show_window=no&id=${id}&mode=prepend&text=${encodeURIComponent(text)}`;
app.openLocation(url);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment