New script to export notes to RTF or OPML (now with RTFD for images)
**** 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/
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! ****
- Sente-OPML-RTF-1.0.dmg 899.6 KB
Showing the most recent page of comments. View the first page
92 Posted by Dana Leighton on 02 Sep, 2012 04:35 PM
Thanks for troubleshooting this Sebastian. I am unfortunately not able to work on the script for the foreseeable future as I have just started a new job. When I can come up for air I will have a look at the script to see if it can handle those characters properly.
Cheers, Dana.
93 Posted by Desalegn on 21 Nov, 2012 08:06 PM
Thank you so much. This is am amazing script, even better from the one that exports to Devonthink. The links back to sente is maintained in the file; the formatting and the images are beautifully exported. I can not ask more. Amazing
94 Posted by yvonne on 10 Dec, 2012 03:53 PM
My CPN still crashes when I import opml files. Any suggestions? RTF works well!
95 Posted by Desalegn on 10 Dec, 2012 06:04 PM
Ask the question in CPN forum; my CPN doesn't crash.
96 Posted by yvonne on 10 Dec, 2012 06:23 PM
Got it now, I was using the wrong page in CPN!
97 Posted by sa on 16 Jan, 2013 05:10 PM
Hi. I can't export my notes properly... I run the script and select a location for the final files, but nothing happens...
What can I do?
Thanks!
98 Posted by Dana Leighton on 21 Jan, 2013 07:37 PM
Hi sa. Can you give a bit of information: (1) what OS version are you running? Can you open the script in Applescript Editor and run it from there? Easiest way is to pull down the Applescript menu in the menubar when Sente is running, Select Open Scripts Folder > Open Sente 6 Scripts Folder, then double-click on the Export Notes... script. Then select the reference you want in Sente, and press the run button in the button bar. Then copy what appears in the "Event Log" area of the window (you may need to go to View > Show Event Log to see it). post it here or email that to me at dana.leighton (at) alumni.whitman.edu and I'll see what I can do. I am very busy with the beginning of the semester so may not be able to get to it for a while.
99 Posted by sa on 22 Jan, 2013 05:52 PM
Hi, thanks for replying!
My OS is 10.6.8 (Snow Leopard)
I downloaded again the file to try to run the script from the scrip editor and I still can not export notes :(.
Unlike what happens when I call the script from the OS bar, when I do it from the script editor I get the following message.
Thanks for your help :)
100 Posted by Dana Leighton on 22 Jan, 2013 06:38 PM
Hi sa,
From what I can figure out, Sente must have updated a build of the SQL engine I am referencing (sqlite3) which references a library (libedit.3.dylib) that exists in Lion and Mountain Lion, but not in Snow Leopard (or maybe an update to Snow Leopard removed it?). In any event, it's not there, so sqlite3 fails. I do not control sqlite3, so not much I can do about it. There is a fix that you can do which involves tinkering with the system via Unix commands. If you want to do it, here's a link to instructions. If you try it, can you let me know whether it works or not?
101 Posted by sa on 22 Jan, 2013 09:23 PM
Oh! I've followed the instructions on the link and everything is fine now!
Thank you, thank you!
102 Posted by sa on 22 Jan, 2013 09:28 PM
The way it places the citation in the text is just perfect!!!
Thanks again :D
103 Posted by Steven on 08 Feb, 2013 07:09 PM
Hi Dana,
Love the script but suddenly I can't run it out of the script menu anymore. It will ask me for the filetype I want to export the notes to but then nothing else. If I run the script from Script Editor it works fine. I've attached an image of the messages in console when I try to run the script from the menu.
Any thoughts?
Thanks,
Steven.
104 Posted by Dana Leighton on 08 Feb, 2013 09:28 PM
Steven, I have seen some script menu weirdness reported by a user on Mac OS 10.5. See this post. I suspect you aren't running 10.5 though. I don't have an explanation at this point. Is it happening with all references or only some? The fact that it "suddenly" stopped working is suspicious. Anything you can think of that might have changed in your system or library?
105 Posted by Nancy on 29 Mar, 2013 03:20 PM
I just installed this script to simply exporting my notes into Scrivener, but it returns no notes. I'm using it with the new Sente 6.6 version, which might be the problem. Do you know if this script works with the update for Sente?
106 Posted by Dana Leighton on 29 Mar, 2013 05:55 PM
Nancy, I have not installed 6.6 yet and so have not tested it yet. Maybe another user who has installed 6.6 can weigh in.
Dana.
107 Posted by Desalegn on 30 Mar, 2013 04:35 AM
Oh, it seems broken on 6.6 version. Mine also failed.
108 Posted by Dana Leighton on 30 Mar, 2013 05:57 PM
I have just installed the 6.6 public preview. I tried it first with Sync1 and then after upgrading to Sync2. The script seems to function normally either way for me.
Nancy & Desalegn, are you using Mac OS 10.6? If so, you should see this post above. Otherwise, can you try the following:
1. From the script scroll menu in the menubar (where you run the script normally), select Open Scripts Folder > Open Sente 6 Scripts Folder
2. in the finder window, double-click on the Export Notes to OPML/RTF.scptd file.
3. This should open up the script in Script Editor. In the bottom of the Script editr window make sure the "Events" and Replies" buttons are active (see screen shot attached)
4. In Sente, select the reference with the notes you want to export.
5. Switch back to the Script Editor, and press the Run button at the top.
6. The bottom of that window should have the Events and Results information. Copy that out of the window and paste into an email and email it to me at dana.leighton atsign alumni.whitman.edu
Thanks - Dana
109 Posted by Nancy on 30 Mar, 2013 06:25 PM
It worked! Yes, I do use Mac OS 10.6. I followed the directions above
" Open up the Terminal, and issue the following commands:
cd /usr/lib
sudo ln -s libedit.2.dylib libedit.3.dylib
"
And now the script works, which will make integrating Sente and Scrivener a lot easier. I love the Sente note taking ability, but I've just been cutting and pasting from the bibliography window, which is slow.
THanks,
Nancy
110 Posted by Dana Leighton on 04 Apr, 2013 04:35 AM
Sebastian wrote above:
Thanks for the library and troubleshooting tips. You are partly right. It is the characters with diacritical marks that are causing problems. It only occurs for RTF and RTFD export formats, and when the length of the note's title is greater than (255 - number of diacritical marks). This is because the characters with diacritical marks are actually stored as two characters in the Mac OS. Thus, the file name will be too long if the title is long enough to exceed the maximum file length (255).
Here is an explanation of the issue with the diacritical marks.
I am working on a solution, but it may be a while.
Cheers,
Dana
111 Posted by Dana Leighton on 06 Apr, 2013 01:42 AM
A new version of the script is released today, v.1.25 - Download this script, not one of the earlier versions.
This version fixed a bug reported by Sebastian that caused by diacritical marks in note titles. If the length of the note title plus the number of diacritical marks was greater than about 250, the script would fail because the title becomes the file name, which is limited to 255 characters. The script now removes diacritical marks from the file name. Also updated the disk image icon and the Finder window background with the new Sente icon.
To update to the new version, simply run the script and it should alert you that there's a new version available.
Alternatively, you may download from here or from my Dropbox site: http://dl.dropbox.com/u/257077/Sente-OPML-RTF-1.25.dmg (1.4 MB download) -- 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.
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.
112 Posted by Ken Whitehurst on 15 Apr, 2013 10:15 PM
When I try to run the installer I get this message: "The operation couldn't be completed. (OSStatus error 100030)
I have previously installed an earlier version of the script.
113 Posted by Dana Leighton on 16 Apr, 2013 02:19 AM
Hi Ken.
Thanks for your report. This is caused by Mac OS 10.8 Mountain Lion's Gatekeeper technology. Basically, it's because the software is not from Apple or an authorized developer. The way around this for now, unless I figure out some other way, is to:
1. Select System Preferences from your apple menu
2. Open the Security and Privacy preferences
3. Set your preferences to allow applications to be downloaded from: "Anywhere" (if the radio buttons are greyed out, you will need to click the padlock icon in the lower left of the preferences window, and authenticate yourself to set the download preference)
4. Double-click the installer to install the script
5. Set your preferences back to their original setting.
Attached is a screen shot of the preferences.
I will have to update the installation notes with this information. Thanks for the heads up.
Dana
114 Posted by Dana Leighton on 21 Apr, 2013 09:45 PM
NOTE FOR USERS OF PRIOR VERSIONS: Download this new version from this thread because a change at Dropbox has caused the automatic update function to fail. This version fixes this problem.
A new version of the script is released today, v.1.26 - Download this script, not one of the earlier versions.
This version includes instructions in the installation notes for cases where Gatekeeper prevents installation of the script. It also updates the script I use for checking for a new version.
Download from here or from my Dropbox site: https://dl.dropboxusercontent.com/u/257077/Sente-OPML-RTF-1.26.dmg (1.7 MB download) -- 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.
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.
115 Posted by Desalegn on 29 Apr, 2013 08:21 PM
thank you. This is great
116 Posted by Robert on 03 May, 2013 02:10 PM
Hello Dana,
I'm running OS X 10.6.8 and Sente 6.6.0. I installed your script, and the installation seemed to go fine. But when I select a reference in the main Sente window, then choose Export notes to OPML/RTF, a dialog appears allowing me to choose RTF, OPML, or RTFD. When I click OK, it allows me to choose a destination folder. Then when I choose a folder and click Choose, nothing happens. Nothing is exported.
Thanks in advance for any help.
Bob L
117 Posted by Dana Leighton on 03 May, 2013 03:20 PM
Bob wrote:
Bob, to fix this see this post and the note at the top of this thread. It is because you're running 10.6.8 and a change made in the underlying SQL code in Sente causes it to malfunction.
118 Posted by Robert Ladd on 03 May, 2013 04:02 PM
Thanks!
119 Posted by Robert on 03 May, 2013 04:32 PM
I don't know how it works, but it works! Thanks again.