Skip to content

Applescript to import NNW smart folder into Yojimbo

David Nunez
David Nunez
2 min read

Today I modified this script which facilitates Yojimbo importing from NetNewsWire

I’ve set up a smart folder in NetNewsWire that grabs the latest 50 flagged headlines from any feed.

I needed this script because I had a technorati watch feed for dorkbot and I wanted to collect blog mentions to send around. I was just flagging articles that mentioned dorkbot-austin and wanted to export a list of bookmarks.

With this, the workflow is now:

  1. Quickly scan headlines in NetNewsWire and do CMD-Shift-L to flag interesting content.
  2. Run this script on the smart folder (this creates a web archive in Yojimbo of each of these articles and removes the flag on the headline in NetNewsWire)
  3. Over time, spend a few minutes working down the list of archived articles in Yojimbo and tag/delete them further as necessary.

Potential problem: This makes it really easy to procrastinate making decisions on what to read and what to do with what I read. Following this strategy will lead to a large pile of unsorted links which I’ll very likely will never find the time to sort through.

I think DEVONThink does a better job of scanning and grouping incoming pieces of text.

I should probably rewrite this to send flagged content directly to DEVONThink. Then, instead of queueing up a long list of articles to read, I’ll let DEVONThink suggest articles for me to read as I do research. Anything that I think I’d want to read immediately I could tag with “@Read” or something similar.

    tell application "NetNewsWire"
        try
            set userInput to text returned of (display dialog "Enter Tag:" default answer "untagged")
            set oldDelims to AppleScript's text item delimiters
            set AppleScript's text item delimiters to {", ", ","}
            set h_tags to text items of userInput
            set AppleScript's text item delimiters to oldDelims
            if (index of selected tab is not 0) then
                set tabnum to index of selected tab + 1
                set taburls to URLs of tabs
                set h_URL to (get item tabnum of taburls)
                set tabtitles to titles of tabs
                set newItemTitle to (get item tabnum of tabtitles)
                tell application "Yojimbo"
                    --set newItem to make new bookmark item with properties {name:newItemTitle, location:h_URL}
                    set newItem to make new web archive item with contents h_URL
                    add tags h_tags to newItem
                    set flagged of newItem to true
                    set isFlagged of h to false
                end tell
            else if exists selectedSubscription then
                repeat with h in headlines of selectedSubscription
                    set h_URL to URL of h
                    set h_title to title of h
                    set isFlagged of h to false
                    tell application "Yojimbo"
                        --set newItem to make new bookmark item with properties {name:h_title, location:h_URL}
                        set newItem to make new web archive item with contents h_URL
                        add tags h_tags to newItem
                        set flagged of newItem to true
                    end tell
                end repeat
            else
                error "No headline is selected."
            end if
        on error error_message number error_number
            if the error_number is not -128 then
                try
                    display alert "NetNewsWire" message error_message as warning
                on error number error_number
                    if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
                end try
            end if
        end try
    end tell
Uncategorized

David Nunez Twitter

Dir of Technology at the MIT Museum • Writing about emerging tech's impact on your life • Speculative insights on the intersection of humanity and technology 🤖

Comments


Related Posts

Members Public

FCC's Vote against Net Nuetrality is a disservice to museums

Yesterday, the FCC voted to repeal the 2015 Open Internet Order and dismantle the order’s strong net neutrality rules (New York Times summary of what happened). You have probably read about how this might impact broadband quality for things like streaming television or even basic websites via tiered access

FCC's Vote against Net Nuetrality is a disservice to museums
Members Public

Requiem for Rhinos - behind the scenes video

Members Public

Automatically Unshortening Links in Wordpress Posts

On this site, I have the Broken Links Checker Plugin chugging away in the background. He tirelessly checks and rechecks every link in every post to find URLs that no longer work; pages sometimes just disappear. In most cases, I’m able to use the Internet Archive Wayback Machine to

Automatically Unshortening Links in Wordpress Posts