Newsletter macro

I am a relative novice in KM and want to put together a macro to automate my newsletter creation. I will be scouring many news stories and turning them into one sentence summaries with link at end.

After highlighting text in a story, I’d to be able to:

  • Paste that text into a dialogue box where I can rewrite to one sentence.
  • Hold that edited text.
  • Pull the article link into another dialogue box where I could reformat into a markdown link
  • Merge the two pieces (edited text)(markdown link) into a single block and save to clipboard.

Is something like that possible and what type actions would be best place to start?

I'd say it is possible, but it will definitely take a fair amount of work.

Perhaps this macro will help you get started:
Set Clipboard to RTF Hyperlink & Plain Text MD Link

Among other things, it allows you to select any text on a web page and create a Markdown link using that text and the page URL.

It would not be too hard to modify that to:

  • Save the selected text (either as plain text or rich-text) separately
  • Create the MD link using the web page title and URL
    • In fact, this option is already in the macro

Since you don't need BOTH a rich-text hyperlink and a plain-text MD link, that will greatly simplify the macro. Just use the parts that you need.

Good luck and let us know how it goes.

Hey Dan,

Don't do that!   :smile:

Working in the very limited text editing environment of a dialog is a serious drag.

If you're editing plain text then use BBEdit.

The demo runs forever with a feature-set comparable with but superior to TextWrangler (which is being phased-out).

BBEdit is designed for editing text and is enormously scriptable, so it is a really good platform doing this kind of work. (It runs 24/7 on my system.)

Here's a very simple example:

Copy Selected-Text and send to a new BBEdit document:

Copy Text and Send it to BBEdit.kmmacros (3.3 KB)

Here's my Go-to-Last-App macro:

Activate Last Application.kmmacros (1.3 KB)

The keyboard shortcut is supremely easy for me to slap and return to the last application I was working in, so I can use a macro like send-to-BBEdit and instantly return to the app I was working in.

It is possible to append text to an existing document and all kinds of other good stuff.

Working with and transforming the text in a BBEdit is fairly straightforward, but you'll have to learn a little bit of AppleScript.

Let me know if you want to pursue this.

-Chris

Thanks JMichaelTX but that looks like more of a challenge than I want to tackle.

Come to think of it, is there a way to simply merge two clipboard items together – the story excerpt and the link?

If I have all the items in the clipboard history I can paste into Ulysses, where I write.

UPDATE Just tested Launchbar clipmerge and it does the trick. I think problem largely solved. Thanks.

You're right, that macro was overkill.

Here is a simple macro to get you started.
It uses Chrome, but can be easily changed to Safari.
Just select some text on a web page, and trigger the macro.
It puts everything you asked for on the clipboard, where you can paste into any app.

##Macro Library   Get Selected Text, Title & URL from Web Page


####DOWNLOAD:
<a class="attachment" href="/uploads/default/original/2X/d/d5cbf866720c55162f3d5884b11e6fb6685f22a3.kmmacros">Get Selected Text- Title & URL from Web Page.kmmacros</a> (2.6 KB)

---

###ReleaseNotes

HOW TO USE:

1. In Google Chrome web page, select text you want to copy.
2. Trigger this macro
3. Switch you any app that accepts text, and paste.

---

<img src="/uploads/default/original/2X/8/8a46046cd3ce1fe6abdb1c251e5e80283655b410.png" width="467" height="976">

Thanks! Already playing around with it.

Further question: I’ve got first half of equation done. Extract text into clipboard that is useful to me. Is there a way to send the clipboard contents to a particular “sheet” in Ulysses. I think U. stores files in a package if I’m not mistaken.

Sorry, I don't know anything about Ulysses app.

The only thing I could suggest is:

  1. Open Ulysses to the sheet you want.
  2. Do your workflow copying text etc from each web page
  3. At the end of the macro, add:
  • Copy (your selected which is your final text)
  • Activate Ulysses
  • Paste