Does anyone know of a bookmarklet for Safari, to add the current page to a TaskPaper file?
Sorry I donāt, Iām actually not very familiar with bookmarklets in the first place. TaskPaper doesnāt currently have a URL scheme, so you couldnāt trigger this action that way. But if itās possible for a bookmarklet to trigger an AppleScript it would be pretty was to get the current URL from Safari and post it into the current Taskpaper document with AppleScript. I just donāt know if bookmarklets can do that.
It should be possible if you look into it and I suspect many people would find it EXTREMELY useful for āRead Laterā and āEmailsā type of projects; either that or a Safari extension which many apps have for doing just what is described. Examples of apps that I use that have user-made bookmarklets include WorkFlowy and GQueues (online) and The Hit List (offline). Actually, here is the bookmarklet for importing into The Hit List, perhaps you can take a look at its structure and see something applicable to TaskPaper?
javascript:function%20addTask()%20%7Bvar%20taskTitle%20=%20%27%27;var%20url%20=%20%27%27;if%20(window.getSelection)%20%7BtaskTitle%20=%20window.getSelection().toString();%7Dif%20(taskTitle%20==%20%27%27)%20%7Bvar%20frames%20=%20window.frames;for%20(var%20i%20=%200;%20i%20%3C%20frames.length;%20i++)%20%7Bif%20(taskTitle%20==%20%27%27)%20%7Bif%20(frames%5Bi%5D.document%20!=%20undefined)%20%7BtaskTitle%20=%20frames%5Bi%5D.document.getSelection().toString();%7D%7D%20else%20%7Bbreak;%7D%7D%7Dif%20(taskTitle%20==%20null%20%7C%7C%20taskTitle%20==%20%22%22)%20%7BtaskTitle%20=%20prompt(%22Enter%20a%20task%20description%20or%20leave%20empty%20to%20use%20this%20site%27s%20title:%22);%7Dif%20(taskTitle%20==%20null)%20%7Breturn%20false;%7Dif%20(taskTitle%20==%20%22%22)%20%7BtaskTitle%20=%20document.title%7Dself.location%20=%20%22thehitlist:///inbox/tasks?method=POST&title=%22%20+%20encodeURIComponent(taskTitle)%20+%20%22&url=%22%20+%20encodeURIComponent(self.location);%7DaddTask();void(0)
Actually 1 thing I notice in looking at this, and the online ones is that they all import to a pre-designated āInboxā database that is separate from the main database of entries; not sure if this would pose a problem with TaskPaper or if itās possible to āpredesignateā a project called āInboxā or āRead Laterā ā¦ actually, a visually separate pre-designated āInboxā for TaskPaper right above the āProjectsā might not be the worst idea.
+1 for bringing a URL scheme to TaskPaper!
My current solution is to use a Keyboard Maestro macro to achieve that.
Would you be willing to share that? I donāt use keyboard maestro but I might be able to use it with Alfred.
Haha, just found that one a minute ago! Just playing with it, seems a very powerful tool.
Hereās a link to an example Keyboard Maestro macro to use as an example:
https://cl.ly/0D121x1x3Q1Y (which captures the item as a Markdown link and adds it to the frontmost TaskPaper document)
Iāve just released v1.0 of the workflow which includes a command dorl (for read later) to grab the active webpageās title, URL and any highlighted text. Also added anew āaltā modifier for working on the Reading List project