NetNewsWire to Yojimbo: Integration

Brought to you by earnmydegree.com: Want to learn more about coding and web design? Get an online web design degree and you can learn more of what you love! There are so many online univerisites that there’s sure to be a learning program that’s right for you. Find a great bachelor degree program!

Brian Yamabe on Yojimbo-Talk Discusson List shows two scripts to send NetNewsWire itmes to Yojimbo for bookmark items or archived items with tags.

The two scripts below are not my own making. Worked without a hitch for me.

NetNewsWire to Bookmark in Yojimbo script:

tell application "NetNewsWire"
    try
        set userInput to text returned of (display dialog "Enter Tag:" default answer "")
        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}
                add tags h_tags to newItem
            end tell
        else if exists selectedHeadline then
            set h_URL to URL of selectedHeadline
            set h_title to title of selectedHeadline
            tell application "Yojimbo"
                set newItem to make new bookmark item with properties {name:h_title, location:h_URL}
                add tags h_tags to newItem
            end tell
        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

NetNewsWire to Archive in Yojimbo script:

tell application "NetNewsWire"
    try
        set userInput to text returned of (display dialog "Enter Tag:" default answer "")
        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 web archive item with contents h_URL
                add tags h_tags to newItem
            end tell
        else if exists selectedHeadline then
            set h_URL to URL of selectedHeadline
            tell application "Yojimbo"
                set newItem to make new web archive item with contents h_URL
                add tags h_tags to newItem
            end tell
        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

Put the scripts in Script Folder in NetNewWire.

NetNewsWire to Yojimbo

For app-specific hot keys, use FastScripts. Assign whatever keys you want.

NetNewsWire to Yojimbo with FastScripts