Changing background color of pasted-in note text


(alj ) #1

Hi all, here’s another small question that I’m hoping there’s a simple answer to. When copying in text from a website (or any app that has styled text), sometimes the background color is also brought in to TBX.

You can see a demo from NYTimes.com in my attached screenshot. I found the options for Format > Style > Standard Size and Format > Style > Standard Font and that made the text somewhat normalized, but they kept the white background color.

This is a two-parter:

  1. How can I “reset” or “normalize” the note text to fully remove pasted-in styles, including background color?
  2. Is there a more TBX-native way to paste in snippets of text from websites that preserves the URL and page title? (Currently, I’m dragging in the web page from the browser, which works great, and then I manually copy/paste the exact text snippet I want. Maybe there’s a one-step solution?)

Thanks!

tbx-text-bg-color


(Mark Anderson) #2

FWIW, I can’t recreate your demo.

#1. Use paste-and-match style. Cmd+Opt+Shift+V.

#2. I’d suggest you drag the URL )or article) to your Tinderbox to create a note that contains the source $URL. Then copy+paste-and-match style your text.

The white background bit appears to be a bug I can replicate but not fully describe (which I’ll report via other channels.)


(Paul Walters) #3

This is a very common problem with copying from a web page and pasting into Tinderbox. To fix the background, select the note(s) with the issue and use Format > Style > Highlight > None

You might have to adjust the note size with a slight jostle to make the note on the map look correct.

I have this problem so consistently that I’ve got a BetterTouchTool TouchBar button defined to fix it. You could do the same with a Keyboard Maestro macro. Unfortunately, I don’t think writing a Tinderbox Stamp is feasible since this they cannot invoke menubar command.


(alj ) #4

Awesome! Both tips (“paste match style” and “highlight none”) worked for me, thanks!

@PaulWalters I’m an Alfred user, but I haven’t searched for any Tinderbox workflows in it. Maybe there are handy one-step “copy from browser” ones available.

@mwra Perhaps the white background bit is a bug, but I assumed TBX was just dutifully copying in all the source styles, which might have included a white background. I can imagine this behavior is unexpected for most uses, but still useful for some (e.g. copying code snippets with syntax coloring).


(Mark Anderson) #5

I thing the white background bit is a bug as it arises after you reset styles. My hunch is it’s due to poorly/mis-defined styles in the source styled text. CSS != RTF, so as $Text is styled (RTF) text it’s unsurprising the odd gremlin may creep in. However, I suspect separate issue is why the space allotted for the title grows by onlv line each time you click the map icon. I think selecting another tab then switching back causes a correct render for now. Either way, the latter bug has been reported.


(alj ) #6

@mwra Gotcha, that makes sense.

Is there a way to have Tinderbox treat the note text (either document-wide, or per-note) as plain text by default, jettisoning the RTF formatting?


(Mark Anderson) #7

In short, no, though i’d agree it would be useful. I rarely if ever want source formatting in data copy/pasted into TBX. Feature request, if someone wants to make it?

You can use shortcut utilities to map Paste-and-match-style to Paste and vice-versa. However, such fixes then tend to me system-wide and not helpful in all other sorts of contents.


(Paul Walters) #8

Pretty common for apps that accept rich text from the clipboard to preserve formatting – but OTOH there are a lot of misbehaving websites. It’s always a crap shoot. For anyone doing a lot of this, consider TextSoap, which can clean up the clipboard before pasting.

Should be easy to write, if there’s isn’t one already.


(alj ) #9

I just did over in “Off the Wall”.

Yes, totally… if there isn’t already a constellation of TBX workflows for Alfred, I can imagine them being relatively easy to build out.