I'd been wanting to reorganize my nvALT tags and was happy to find this. However, when I run the “makeTagsList” application, enter "txt" as the extension, and point to my notes folder, the following alert appears:
The action "Run Shell Script" encountered an error.
Check the action's properties and try running the workflow again.
Googling that error didn't reveal any useful results. I realize this could be specific to my set up (2008 Mac Pro running OS X 10.7.5 but would be grateful for any suggestions as to how I can get the makeTagsList app to run successfully.
Thanks...
Yes ! A missing feature in nvAlt. Unfortunately it failed to convert accented characters for the html file. Instead of “é” it writes “e\u0301” correction is easy in BBEdit but still a little bug.
UTF-8 encoding in Ruby is a cluster. I'll see what I can do to smooth it out, but no promises immediately.
It's not Ruby's fault. Mdls gives output like this
(
"\U6536\U96c6"
)
we can convert this unicode values to actual characters.
change this lines:
cmd = %Q{mdls -raw -name kMDItemOMUserTags #{Shellwords.escape(file)}}
tags_raw = %x{#{cmd}}.gsub(/\((.*)\)/m,"\\1")
tags = tags_raw.split("\n").map! {|tag|
to this
cmd = %Q{mdls -raw -name kMDItemOMUserTags #{Shellwords.escape(file)}}
tags_raw = %x{#{cmd}}.gsub(/\((.*)\)/m,"\\1")
re = /\\U[0-9a-fA-F]{4}/
tags_raw = tags_raw.gsub(re) {|match| Array(match[2..5].to_i(16)).pack('U') }