On a Mac, I can use an AppleScript to open a file in Excel. LibreOffice doesn’t seem to have an AppleScript dictionary. Is there some other way (maybe from the command line?) that I can tell LibreOffice to open a file, using Calc in particular? (The file is tab-delimited text, so if left to its own devices, LibreOffice would open it in Writer, which would not suit my needs.)
If you rename the file with file name extension .tsv (Tab Separated Values) it is automatically opened in Calc. Also if you open a .txt file while a Calc spreadsheet document is open it is opened in Calc. From command line you could use the --calc
option, so soffice --calc filename.txt
should open it in Calc as well. But I don’t know if and how that works on a Mac.
This is very helpful, thank you.
In case anyone else is wondering about this–On a Mac, you can make LibreOffice the default app for documents of type .tsv, and then use open /path/document.tsv
from the command line. That brings LibreOffice to the front, with the normal import dialog for Calc.