Question: drag text from webpage and have the URL included in the resulting Tinderbox note?

Hi,

for my research I often only need snippets of text from a webpage, but certainly need a documented source.

When I mark a couple of sentences on a webpage with my mouse, I can drag it into Tinderbox and have a note created that contains that text (plus its first sentence as $Name of the note). I does not, however, automatically include the source - the URL of the webpage - into the note, as far as I can see. Of course I could go back to the browser, copy the webpage’s address and put that into the Tinderbox note’s URL attribute (if I display it).

But I would much prefer if that could be done automatically when I drag the text over to Tinderbox. Does anyone have an idea or suggestion - or can confirm that this is not possible?

Thanks and best wishes,

Andreas

Currently, if you drag a browser text selection into Tinderbox the result depends on where the item is dropped:

  • View pane:
    • Onto the background (regardless of whether a note is selected). A new note is created with the dragged text. If there is more than one sentence it is used for the $Name of the note or the $Name is the whole drag-text. The whole dragged text is also used for the new note’s $Text (source formatting is not retained). No $URL is set.
    • Onto a note (regardless of whether a note is selected). The same occurs but the new note is added as a child of the dropped-upon note.
  • Text pane:
    • No note selected. The drop is not accepted.
    • Text area of a selected note. The text is added to the $Text at the location of the cursor when dropped. The dropped text retains source style. There is no way to drop-and-match style. The source URL is used to set $URL; if $URL is already populated for that note it is left unchanged. Dropping content on the Displayed Attributes table of the note (if there is one) has no result.

This is the behaviour as (re-)tested in v8.9.1. I would agree that in the former case - dragging onto the view, it makes sense not to use the URL. We know the URL data is in the drag payload given the behaviour if dropped on the text area. Given the source of the data, there seems no real gain in not using the available URL info (and perhaps setting as a Displayed Attribute so it is available for immediate use).

. If you need to shed the source (i.e. web page) text styling use Copy (⌘+C) → Paste-and-Match-Style (⌘+⌥+⇧+V)

. Note that dragging a browser’s current URL onto a $URL in Displayed Attributes will set it (see more).

Edit: added note re pasting with/without style.

I can add that if you want something fancier you can find bookmarklets that have been made with Javascript to copy URL, page title, and selected text to the clipboard that then can be pasted into a note if you don’t want the whole note linked to that URL.

For me, it’s a great use of Keyboard Maestro because I can format the pasted info just how I like it which works well when you are working in Markdown. Here’s a nice step by step guide to this:

1 Like

Many thanks, Mark A., for that detailed information! It is very helpful to me.

And I am also grateful you support my suggestion that in dragging a text selection onto the view to create a new note, the URL (which is in the payload) should be used and the URL set as a Displayed Attribute. Thus I link Mark B. (@eastgate) to this note and hope he will consider making the necessary change!

1 Like

Many thanks, that looks interesting as well! But if I only need the source URL and not the page title, I’d rather hope for a respective change in Tinderbox as @mwra suggested.

1 Like

I think we can do this; I’ve added it to the roadmap.

2 Likes

Thank you! Looking forward to it! :pray:

I’ve added a page on this to aTbRef: Dragging text from a web browser.

1 Like

Mark, can I ask again about the state of this? I thought it had been added to Tinderbox 8 (but I my memory is unreliable), but trying it in Tinderbox 9 shows it does not work (while the URL is being recorded, it is not automatically being displayed).
Can you enlighten me? Many thanks in advance!

I’v set the $Edict’s default value in Document Inspector > System to

if $URL { 
	if !$DisplayedAttributes.contains("URL") 
		{$DisplayedAttributes=$DisplayedAttributes+"URL"}; 
	if ($Edict=attribute("Edict")["default"];) 
		{$Edict="";} 
};

(You could add a line that removes the edict if a note got $Text)

We don’t automatically make $URL a displayed attribute, because this might well be unwanted. But it’s very easy to do! Some approaches:

  1. Just press the Displayed Attributes button, and URL to the end of the list, and click away. You’re done.

  2. If you’re doing a bunch of these, make a prototype Research Note with URL as a displayed attribute. When you import a resource, assign this as its prototype. Even faster than method 1.

  3. @Pete’s default Edict will work fine! But default actions worry me. I’d do the same thing with a low-priority agent. Query: $URL!="". Action: $DisplayedAttributes = $DisplayedAttributes + “URL”. Either way, automatic!

  4. I myself would make a prototype, and then use the OnAdd action for the container with these research notes to set $Prototype=“Research Note”. Again, no additional steps!

2 Likes

Thanks, Mark, for your time and the various suggestions to solve my issue! Your preferred option is the one I think I will adopt. Thanks again! And thanks to @Pete as well for his suggestions.

By the way: there is no way to trigger the Displayed Attributes button via the keyboard, is there? I could not find one in the menus - but it would be occasionally very useful…

Really? Have your tried [Cmd]+[Shift]+[K]? Or here.

Thanks, @mwra - but [Cmd]+[Shift]+[K] opens and closes the Displayed Attributes. What I was referring to (using @eastgate’s words) was the button that opens up the selection of the Displayed Attributes (hovering over it reveals “Add Displayed Attributes”). Will check aTbRef for that phrase, maybe there is something that I am unaware of so far!
Edit: Under the “View” menu, the popover can be opened as “Edit Displayed Attributes…”. But not keyboard shortcut (so far…).

CustomShortcuts is far more comfortable than macOS’s system preferences.

I’m confused. Why not click the button? This seems a bit of a First World problem.

You can add your own shortcut in System Preferences if you like.

I’m open to suggestions here. We have an awfully large number of shortcuts, and there are only so many letters.

1 Like

Because it means taking the fingers from the keyboard and using the trackpad.
But @eastgate is right (comment below) - I could do a custom shortcut rather than to wait for an official one.

1 Like

Thanks, Mark, I think you’re right here! Useful suggestion.