New script to export notes to RTF or OPML (now with RTFD for images)

Dana Leighton's Avatar

Dana Leighton

03 Aug, 2010 02:21 AM

**** There is a new version of this script - click here for the most current version.

**** Update: 16-Aug-2010 - If you're running Mac OS 10.5 Leopard, and have trouble invoking the script from the Scripts Menu, see the workaround below - click here

**** Update: 25-Feb-2013 - If you're running Mac OS 10.6.8, an update to Sente's Sqlite engine seems to have broken the script's functionality. For a fix for this see this post

Suggestions seemed like a reasonable place to post this, although it's not a suggestion, but rather a solution.

I use a writing program called Scrivener, and wanted a way to export Sente notes to it. I used the houthakker script that exported to DevonThink, then exported the DevonThink files to OPML and imported to Scrivener. After the DevonThink trial ran out and I decided not to license it, I decided to modify the houthakker script to write out to OPML for import to Scrivener.

Well one thing led to another, and I created a script that exports Sente notes to either OPML or RTF. I learned a lot about Applescript and relived my previous career as a software developer, but I'm an academic now, and have to get back to some real work.

Anyway, The attached file is a disk image which contains the script, an installer that installs it in the right place, and installation and use instructions. It is licensed under the Creative Commons GNU GPL license which means you can use it, modify it, and redistribute it to your heart's content. i just hope it's as useful for you as it was for me. It is distributed without any warranty for its fitness or usefulness. Details of the license are in the disk image, or here: http://creativecommons.org/licenses/GPL/2.0/

I created a video tutorial on using the script to export notes from Sente into Scrivener. It is available from the following link:

http://youtu.be/E17pX31UgUo

If you do find it useful, and you feel the urge toward reciprocity, please consider donating to my favorite charity, the Lance Armstrong Foundation, which does great work for cancer survivors: http://www.livestrong.org/

If you run it and encounter any problems or have suggestions, use the email address in the Installation Notes or post a message in this thread. I'll do my best to work on it some more, but I am getting really busy with research. Better yet, if you find a problem and can fix it or modification to improve it, send me the details so I can fix it for the next release (if there is one).

Cheers,
Dana Leighton

**** NOTE: Do not download the dmg linked to this comment. See the newest version linked to at the top of this comment! ****

Showing page 6 out of 6. View the first page

  1. 151 Posted by Dana Leighton on 19 Apr, 2014 10:55 PM

    Dana Leighton's Avatar

    Sarah wrote:

    First, is there a way to modify the script so that it would also export any attachments connected to the reference?

    I do not think so. The attachments are outside the Sente database, and I have not investigated the database structure enough to know if there is a way to determine the path to the attachment. I also am not sure what I would then do with it. Sorry. I use this script from Michelle Gill when I want to export attachments.

    (edit) Perhaps there might be a way to integrate Michelle's script with mine, but I'm not able to look at it right now.

    Second, and far less importantly, is it possible to edit the script for formatting (e.g. change the font)?

    It should be. However I have had trouble doing so. See this post above. If you modify the script and it works on your system, would you let me know please so I will know if it's something wonky about my machine?

    Thanks again for a great script!

    You're welcome! I am glad it is helping you.

  2. 152 Posted by mbradaschia on 20 Apr, 2014 10:26 PM

    mbradaschia's Avatar

    Hi!
    Any ideas why the opml format cannot be read by other outliners apps, like OmniOutliners ou mind maps apps, as MyThoughts?

    Rds.
    Marcelo

  3. 153 Posted by Dana Leighton on 20 Apr, 2014 10:51 PM

    Dana Leighton's Avatar

    Marcelo wrote:

    Any ideas why the opml format cannot be read by other outliners apps, like OmniOutliners ou mind maps apps, as MyThoughts?

    Actually, it works great with either one. I specifically modeled the OPML structure after what OmniOutliner used, and I just tried importing to both. Screen shots attached.

    If you read the installation notes, you will notice that The OMPL "specification" is not a specification. It is more of a half-baked idea for a formatting specification. Thus, there aren't really any standards for the file. I intuited what I could from how OmniOutliner does things, and it seems to work in My Thoughts (a very nice looking app by the way), but because of the lack of a specification, it may or may not work in other software.

    Cheers,
    Dana

  4. 154 Posted by mbradaschia on 21 Apr, 2014 12:01 AM

    mbradaschia's Avatar

    Dana,
    That's weird... it doesn't work for me (screens attached).

    Well it, worked with MyThoughts, but not with iThoughts.

    But with OmniOutliner it doesn't.

  5. 155 Posted by houthakker on 21 Apr, 2014 12:32 AM

    houthakker's Avatar

    OO4 (Marcelo) vs OO3 (Dana) ...

    OO4 seems to contain a number of glitches and regressions. Perhaps this is one of them.

  6. 156 Posted by Dana Leighton on 21 Apr, 2014 01:15 AM

    Dana Leighton's Avatar

    Thanks houthakker. That's too bad OO changed something in their files. I will have to upgrade and see what the problem might be.

    As I said in the Installation Notes, OPML is not a specification as much as it is a general idea developed by Dave Winer - see here. Although he outlines the "spec" for it, there is so much (intentional?) flexibility for the definition of attributes that any given developer can specify all kinds of attributes in their file format that can be meaningless, or worse, toxic to the importer of another OPML supporting program. See this page for the bloody details.

    For example, I am using the attribute "_note" which OmniOutliner uses (or at least used to), but may or may not be supported by any given OPML processor. It really is a bit of a mess.

    Anyway, enough of my frustrations with OPML. I'll see what I can do about looking at OmniOutliner 4 to see what I might need to fix. Hopefully that'll be backward compatible!

    Cheers,
    Dana

  7. 157 Posted by houthakker on 21 Apr, 2014 02:33 PM

    houthakker's Avatar

    I don't currently have a copy of Sente on my system, but the developers should have a good sense of what it is that they have changed, and I will, I think, be able to advise on what edit might might be required to the script.

  8. 158 Posted by frh2106 on 21 Apr, 2014 02:47 PM

    frh2106's Avatar

    Ok, that would be great because I think there are a lot of people who use this. Any help would be greatly appreciated. I wish I knew how to maintain it, but I just don't have the programming skills (yet). Is there anything I could do to help? I've been in contact with DevonThink to ask them to give me a link to version 2.7.3 at least in the meantime.

  9. 159 Posted by Dana Leighton on 21 Apr, 2014 04:33 PM

    Dana Leighton's Avatar

    Please take any discussion of the houthakker Export Notes to Devonthink script to that topic: http://sente.tenderapp.com/discussions/suggestions/34-export-notes-...

    frh2106: can you split your discussion off? Thanks.

    Thanks.

  10. 160 Posted by frh2106 on 21 Apr, 2014 05:57 PM

    frh2106's Avatar

    sorry about that. The split doesnt work but i tried to re-start the discussion there.
    -------------------------
    Francis R. Hittinger
    Ph.D. Candidate Italian/ICLS
    Digital Humanities Fellow (2013-14)
    Columbia University
    [email blocked]

  11. 161 Posted by mbradaschia on 21 Apr, 2014 06:36 PM

    mbradaschia's Avatar

    Dana,
    I spent some time yesterday trying to figure out what's happening...

    Well, some weird stuff:
    - I don't think the problem is with OO4 format. I think there is something wrong with my file - When I opened the SenteNotes.opml in Sublime Text (text editor) it seems to have a NUL character (screen attached) - That is not the only problem, since deleting the character didn't solve the issue.

    Well, I attached also my exported file as is for you to take a lot when possible.

    I don't know if there is something to do with using accented characters like "á à ã". Since I'm a portuguese speaker that's usual for me.

    Rgds,
    Marcelo

  12. 162 Posted by Joe on 21 Apr, 2014 07:15 PM

    Joe's Avatar

    Sorry if this gets repeated. I wrote the wrong email address by mistake in the first message, and I'm not sure if it will show up here.

    The problem isn't with a particular file. I tried to export notes from Sente as OPML, and OO4 wouldn't open up mine either. Neither would iThoughtsX. I was, however, able to open it in Circus Pony Notebooks, I then exported from from there as an OPML, and OO4 was able to open it. (Not sure what the original "should" look like, but in Circus Pony Notebooks there are three columns, in the exported one I opened in OO4, there are three columns, but the middle one is empty. The actual notes are the daughter of the title of the note.

    I've included both files, in case it helps anyone figure out what the problem may be.

  13. 163 Posted by Dana Leighton on 21 Apr, 2014 08:55 PM

    Dana Leighton's Avatar

    Thanks Marcelo and Joe. I see the null character in both of your files. I can't see where it's coming from in the script, but it is definitely there.

    I can't test OO4 because I can't download it. I am not yet on Mavericks. This may be the impetus I need to move to 10.9 - something I might take on over the summer but not now.

    If someone else can see what the problem is and point me toward a solution, that would be helpful.

    Otherwise I'll be back to this in a few weeks.

  14. 164 Posted by houthakker on 21 Apr, 2014 09:46 PM

    houthakker's Avatar

    A null character sometimes comes from unintentionally escaping a zero: \0

  15. 165 Posted by mbradaschia on 22 Apr, 2014 01:16 AM

    mbradaschia's Avatar

    Good news!!!

    I found the NULL character... It was in the property XML_body, before the closing "

    But, the script was still not working...

    After many tests I discovered that some apps could not read the file if the first line was blank. So I changed it in the script also...

    Now it is working like a charm!!!

    \o/

    The attached file has the fixed script.

    Dana, could you take a look if it is ok, and if it is release an upgraded version?

    Rgds,
    Marcelo

  16. 166 Posted by Dana Leighton on 22 Apr, 2014 02:44 AM

    Dana Leighton's Avatar

    Thanks to Marcelo, a new version can be released today (the first one in a year!)

    A new version of the script is released today, v.1.27 - Download this script, not one of the earlier versions.

    This version fixes the OPML export XML code to increase compatibility with OPML importers. Also fixed a file creation error dialog box.

    if you have a prior version installed, go ahead and run the installer for the new version as it will ask if you want to overwrite the already installed script. If you get an error in the installer, see the installation instructions to work around it.

    Or you can download from here or from my Dropbox site: http://dl.dropboxusercontent.com/u/257077/Sente-OPML-RTF-1.27.dmg (1.8 MB download)

    NOTE to users of versions prior to 1.20: If you do not use the installer to overwrite a prior version, you must delete the old script after copying the script to the Sente 6 Scripts folder. This version has a different file extension: .scptd rather than .scpt because the new script is a bundle.

    As usual, please comment here or send email to the address in the installation notes for bugs or suggestions.

  17. 167 Posted by Ken Whitehurst on 22 Apr, 2014 12:44 PM

    Ken Whitehurst's Avatar

    For what it's worth: I tried to use the installer as attached and downloaded and in both cases received an error message it was "damaged." Has anyone else successfully run the installer?

  18. 168 Posted by Dana Leighton on 22 Apr, 2014 01:32 PM

    Dana Leighton's Avatar

    Ken wrote:

    I tried to use the installer as attached and downloaded and in both cases received an error message it was "damaged."

    Ken - this is because of the new way Mac OS X 10.9 Mavericks handles files from unknown developers. See the Installation Notes PDF on the disk image regarding how to set your security preferences to allow the installer to run. Also see this post above:
    https://sente.tenderapp.com/discussions/suggestions/205-new-script-...

  19. 169 Posted by frh2106 on 24 Apr, 2014 04:09 PM

    frh2106's Avatar

    Dana, Thanks so much for this work! Since this is a much more active community with this script, and this also helps those of us importing into DevonThink could you add one more little feature to the script: namely, enabling a feature that would allow the inclusion of a PDF attachment from the target reference attachment (if any) inside the target reference fold upon export to RTFD, OPML, etc.
    Thanks for your great work! :)

    Francis

  20. 170 Posted by Dana Leighton on 24 Apr, 2014 04:31 PM

    Dana Leighton's Avatar

    Francis - I have had one other person make that request (see Sarah's post above). I will add it to the list of enhancements that I can tackle in the future. But, it may be a very long way off, depending on the results of my current job search! :-/

    I see you have looked at Sente Assistant - does it do that?

  21. 171 Posted by ccbirdsall on 13 May, 2014 08:09 PM

    ccbirdsall's Avatar

    [second attempt at posting this, apologies if it's a duplicate] Dana, thank you for all your work on this script. I am attempting to modify it to include a bibtex key in the notes, but I cannot find where I would add that in your script. In the Sente xml file the field is "BibTeX cite tag". Any help is appreciated. Thanks!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac