Jump to content
luckman212

Alfred4: RichText (RTF) snippets + Evernote = no luck

Recommended Posts

Posted (edited)

I was super excited to hear about RichText being added to the Snippets function, and one of the first things I did was try it out with Evernote. I have certain styled blocks of text that I want to always re-use in Evernote and I was hoping to use Alfred as a simple template library for these. Alas, it doesn't seem to work right.

 

Example, here's a section (simple text/codeblock) that I wanted to make into a snippet. In EN it looks like this:

image.png.a4dbe7d5458b22505838e06752e5f3e2.png

 

I created a RichText snippet from this and then tried pasting it into a note, here's how it came out:

(note the codeblock formatting is missing, there is a faint gray background separating each line of text, and the header font has changed from Arial to Times)

image.png.b9ddc89c4a71a5b35710ac740581c7a6.png

 

Not sure if this is fixable from Alfred's side or if it's just a peculiarity of how Evernote deals with rich text but... it's no good 😟

For comparison, the same snippet saved in PasteBot and then pasted into EN works fine and is perfectly formatted.

 

(Alfred 4.0.1 b1078)

Edited by luckman212

Share this post


Link to post

@luckman212 I too got my hopes up about using snippets to paste appropriately styled text into Evernote and the Notes app. 🤦‍♂️

 

To be honest, I wasn't surprised by Evernote. It's always been flaky. At the moment, I can't even get it to accept Rich Text snippets from Alfred that aren't discolored or without some other problem (I use the app in Dark Mode).

 

However, I was a little more surprised by the Notes app, since it's native to MacOS. Any ideas how to maintain its simple Title, Heading, or Body tags?

 

Has anyone else had any luck using snippets with formatted text in Evernote or the Notes app? It's got to be possible to apply the appropriate tags or styles to snippet-related text - even if it's processed via another step. Thanks for any help you can lend!

Share this post


Link to post

Notes is quirky.

 

From Alfred, I can get bold, italic and underline to stick, and bullets, but nothing else.

 

From Ulysses, if I Copy as RTF, I can get headings (## or H2) as headings but titles (# or H1) come in as headings as well.  Or, rather, Notes doesn't treat H1 as a title.

 

 

Share this post


Link to post
4 hours ago, Jasondm007 said:

Has anyone else had any luck using snippets with formatted text in Evernote or the Notes app?

 

Looking at the raw data, it's just basic RTF formatting. Title = 34pt size and Heading = 24pt.

 

So if you format your text to 34pt, in Notes.app it shows style "Title". Same for 24pt and "Heading".

 

image.png.c85304e513680bff0ed2bd28bfcc3dcc.png

 

image.png.9b4bba7e093dbba521789320b6327c43.png

Share this post


Link to post

Hi @dfay & @deanishe  - Thanks for the feedback and for taking a crack at it! I really appreciate it.

 

@deanishe I've tried this countless times today, and just haven't had any luck.

 

So that I'm clear, are you recommending, in Alfred's snippet viewer, to change the font size as follows: Titles to 34, Headings to 24, and Body to 12 (or anything, since Body appears to be the default)? If so, are you also defining the Family and Typeface (Yours looks like Helvetica Neue - Regular)? Finally, once you trigger the snippet in the Notes app, yours automatically recognizes everything appropriately?

 

I've tried countless variations, and my text usually comes out with Body tags - i.e., regardless whether it actually looks looks identical to the Notes app's text. However, I did notice that if the text is 34, or larger, it's usually recognized as a Heading. That said, I was never able to find the appropriate size or settings for Titles. 

 

If possible, could you share your working snippet?

 

Just for testing purposes, I also tried changing the ⌘V shortcut from "Paste" to "Paste and Retain Style" and it didn't fix anything either (Notes - Edit - Paste and Retain Style). FWIW - it did seem to create some new problems with the color of the text, however - often pasting the text in charcoal/black so that it was unreadable on a dark background. In any case, I've switched things back to normal.

 

Lastly, I'm not sure if it's helpful, but since we both appear to have different settings, I've included a few screenshots of my settings from the Notes app below. The first image shows my preferences in the app, and images 2-4 show what the text would look like if it were formatted appropriately.

 

As always, thank you both for all of your help!

 

Preferences - Image 1

1391208457_NotesPreferences.jpg.26cc2a2e2cf9da08f2499d7d59b05362.jpg

 

 

Default Formatting in Notes app by tag, showing Fonts panel - Images 2-4

1533572806_Title-NotesDefault.jpg.f331af36592022c69289a578014b9c1e.jpg

 

485146708_Heading-NotesDefault.jpg.ebe451a3e3ce29d59b7cfea0288c7fbc.jpg

 

185988644_Body-NotesDefault.jpg.2ac457551a47e77a412f5233fc553b78.jpg

Share this post


Link to post
Posted (edited)

Hi @deanishe and @dfay - OK, please ignore my previous post. After doing some more goofing around, I was able to find something that works on my system. Thanks again for all of your help!

 

To be clear, I have no idea why it works, and the other tests did not.  However, if others would benefit - and presumably have similar Notes settings - here's what worked for me in Alfred:

 

142035656_Snippet-Title.thumb.jpg.68b2109102db2349ae965b5affa0b7c5.jpg 

 

411435180_Snippet-Heading.thumb.jpg.29c8e0330b4419842d6c5b8cbb5278b6.jpg

 

1962280694_Snippet-Body.thumb.jpg.a236c9494863179c29a9e66af6b0689c.jpg

 

PS - Each is designated as a "System Font"

 

PPS - Just to be clear, the text does not look this way in the Notes app when the snippet is used. It's formatted in the appropriate tags - which for me is 17, 14, 12.

Edited by Jasondm007

Share this post


Link to post
Posted (edited)

I'm on High Sierra, so that might make a difference.

 

I don't have the snippet any more: I deleted it.

 

What I did was create a note in Notes.app, copy it, then inspect the raw RTF with ClipboardViewer.

 

On High Sierra, I see the following (relevant bits after the first empty line):

{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600
{\fonttbl\f0\fnil\fcharset0 AppleSystemUIFontBold;\f1\fnil\fcharset0 AppleSystemUIFont;}
{\colortbl;\red255\green255\blue255;\red53\green53\blue53;}
{\*\expandedcolortbl;;\cssrgb\c27059\c27059\c27059;}
\deftab560
\pard\pardeftab560\partightenfactor0

\f0\b\fs34 \AppleTypeServices\AppleTypeServicesF2293774 \cf2 This is the title\
\pard\pardeftab560\slleading20\pardirnatural\partightenfactor0

\f1\b0\fs24 \AppleTypeServices\AppleTypeServicesF2293774 \cf2 \
\pard\pardeftab560\slleading20\partightenfactor0
\cf2 This is the intro\
\pard\pardeftab560\slleading20\pardirnatural\partightenfactor0
\cf2 \
\pard\pardeftab560\sa40\partightenfactor0

\f0\b\fs28 \AppleTypeServices\AppleTypeServicesF2293774 \cf2 This is a header\
\pard\pardeftab560\slleading20\pardirnatural\partightenfactor0

\f1\b0\fs24 \AppleTypeServices\AppleTypeServicesF2293774 \cf2 \
\pard\pardeftab560\slleading20\partightenfactor0
\cf2 This is some text}

\fs34\fs24 etc. are text sizes.

 

In Alfred, I entered the text and then only changed the sizes of the title and header lines. Didn't touch the font or anything else.

Edited by deanishe

Share this post


Link to post

@deanishe Thanks! Yeah, maybe it's a Mojave thing? 

 

I gave the Clipboard Viewer app a try, and boy is that thing confusing!

 

In any case, here are my settings for the text, as it appears in Notes w. the same text as above:

{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf500
{\fonttbl\f0\fnil\fcharset0 AppleSystemUIFontBold;\f1\fnil\fcharset0 AppleSystemUIFont;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\deftab560
\pard\pardeftab560\partightenfactor0

\f0\b\fs34 \AppleTypeServices\AppleTypeServicesF2293774 \cf0 Title Text\
\pard\pardeftab560\slleading20\partightenfactor0

\f1\b0\fs24 \AppleTypeServices\AppleTypeServicesF2293774 \cf0 \
\pard\pardeftab560\sa40\partightenfactor0

\f0\b\fs28 \AppleTypeServices\AppleTypeServicesF2293774 \cf0 Heading Text\
\pard\pardeftab560\slleading20\partightenfactor0

\f1\b0\fs24 \AppleTypeServices\AppleTypeServicesF2293774 \cf0 \
Body Text}

 

Share this post


Link to post
11 minutes ago, Jasondm007 said:

I gave the Clipboard Viewer app a try, and boy is that thing confusing!

 

Not the most polished app (it's just a demo of the clipboard APIs), but I really like it. It's cool to be able to see all the different formats apps copy data to the clipboard in.

 

14 minutes ago, Jasondm007 said:

In any case, here are my settings for the text, as it appears in Notes w. the same text as above:

 

Weird. The text sizes look the same as for me, but you say you need different sizes to get Notes.app to work.

 

Perhaps I'm completely wrong and was just lucky…

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...