Bookmarklet for Safari on OS X?


#1

Does anyone know of a bookmarklet for Safari, to add the current page to a TaskPaper file?


#2

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.


#3

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)


#4

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.


#5

+1 for bringing a URL scheme to TaskPaper!


#6

My current solution is to use a Keyboard Maestro macro to achieve that.


#7

Would you be willing to share that? I don’t use keyboard maestro but I might be able to use it with Alfred.


#8

Have you check this? Alfred 3 workflow for TaskPaper 3


#9

Haha, just found that one a minute ago! Just playing with it, seems a very powerful tool.


#10

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)


#11

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