Note that since Mojave, scripts must be edited in Script Debugger. And Catalina users should read the documentation for details of how to deal with Gatekeeper changes.
I also like the CSV support, although neither Numbers nor Excel open your sample CSV correctly when naming the file “TestCSV.csv”. Not even with Excel’s Data / Text to Columns… command it can be scanned correctly.
Yes, it doesn’t seem to like a single double-quote at the beginning of a field.
The csv-parsing is code I added, and I think I was stressing it at the time I wrote that example – it would probably make more sense to use something more, um, normal (if there is such a thing as normal CSV).
Shane, I know there are many flavors of CSV, but if there is one standard used the most worldwide it is probably Excel. So if you could make your CSV export compatible with Excel that would really be great!
It’s not actually an export. The script contains a small CSV-style string, which it then saves to disk (to demonstrate loading CSV from both a string and a file). The string deliberately pushes the boundaries of what’s acceptable to demonstrate that the import parsing is very flexible.
The underlying framework, and hence this lib, do not support CSV export. Feel free to log a request, but I’m not sure it would be a priority. I think this is more a tool for maintaining and querying databases, rather than exporting their contents as a whole.
Quick question, while debugging this I encountered a “database is locked” error. I think the script stopped before a commit command. But I couldn’t figure out how to unlock it. I just put it in the trash and started over.
I don’t think it’s an SD issue. I think it’s SQLLite.
Basically if a script is interrupted before it commits then the record (or something) gets locked. You can still open and close the database, you just can’t do anything with it.
This is a real drag for me. Every time I try to start working with this, I end up having to quit and relaunch numerous times. If there’s one feature I’d love to see it would be a way to simply close the database without having to relaunch.