Last active
May 17, 2019 06:53
-
-
Save tkrkt/9b46503cc2111ef9f19b7f1922b39f81 to your computer and use it in GitHub Desktop.
[Alfred] [Bear] append tweet to bear
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
// 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