Mac *.txt.rtfd to *.txt

In a recent project, an assistant used TextEdit to supposedly save documents as pure (UTF-8) text files. We managed to fix the workflow, but I was left with a bunch of Zip files full of *.rtf from TextEdit. On a Windows or GNU/Linux machine, these files show up as what they are: folders that contain a rich text document (and potentially other stuff). I needed text documents.

After a bit of searching and tweaking, I got the following shell script to convert all the rich text documents in these folders/containers into text documents:

find . -name '*.rtf' -exec unoconv -f txt {} \;

There was a problem, though. The files all had a name containing important meta data. So I had the folder with the name of the file, and inside this folder the file but it was called TXT.txt (converted from TXT.rtf). I’m sure there’s a quick way in a shell script (if you know one, please share it in the comments), but I got stuck with the shell.

Enter LiveCode. Here’s a script that does just that. I guess I could have called the above shell script, but I already had this.

on mouseup
-- INPUT: select a folder with the *.txt.rtfd folders
answer folder "Input: Choose folder:"
put it into infoldername
set the defaultFolder to infoldername
put the folders into listoffolders
-- filter . and .. can cause problems
filter listoffolders without "."
filter listoffolders without ".."
-- OUTPUT: select a destination folder
answer folder "Output: Choose folder:"
put it into outfoldername
repeat with i = 1 to the number of lines of listoffolders
put line i of listoffolders into currentfolder
revCopyFile infoldername & slash & currentfolder &
slash & "TXT.txt", outfoldername & slash & textname
end repeat
end mouseup

Full LiveCode stack here on OSF (it’s nothing more than a button and a text field with a basic log).

Yoshikoder won’t start on Ubuntu

Two days ago my Yoshikoder refused to start on the Ubuntu (GNU/Linux) machine. So I tried in the console java -jar Yoshikoder-0.6.4.jar and was informed that “Error: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper”. A quick on the web look turned out that the solution is simple. In the console, I opened the following file:

sudo leafpad /etc/java-11-openjdk/accessibility.properties

and commented out the line causing problems (in my case it was the last line), so that it reads:

#assistive_technologies=org.GNOME.Accessibility.AtkWrapper

Sorted.

Zotero on Ubuntu Does Not Update: How to Fix the Permissions

My Zotero did not update, showing a dialog that while there is an update available, I apparently lacked the permissions to update. First I tried to chmod the directory where I extracted Zotero to, and the Zotero binary, but that did not change the error message. It turns out there is another directory that needs to be changed:

sudo chmod 707 /usr/bin/zotero && sudo chmod -R 707 /opt/zotero

(in the terminal) and now everything works as it should.

Update 10 April 2019: see comments for a more appropriate handling of the permissions.

Let Rhythmbox play MP3 again

Today I noticed Rhythmbox not playing some music files in Debian. After a bit of digging around, I noticed the warning “your gstreamer installation is missing a plugin” in the file properties. From there it wasn’t far to realize that MP3 files did not play in Rhythmbox (any more), and that I probably need a (new) plugin (it’s Debian ‘unstable’ after all, so this was probably introduced by a recent update). sudo apt install gstreamer1.0-fluendo-mp3 and restarting Rhythmbox was all I needed to do.