Ask Your Question
0

Using LibreOffice with Terminal

asked 2019-10-13 02:13:14 +0200

nwood gravatar image

Hi,

I'm trying to convert a .docx file to a .txt file using Terminal and LibreOffice. However, I can't seem to get the soffice command to work. What are the steps I need to take to get soffice to work on MacOS with Terminal? I'm trying to run this command: soffice --headless --convert-to txt...but I get -bash soffice: command not found. I'm going crazy trying to get the command line tools to work with LibreOffice. :(

Thanks! Nathan

edit retag flag offensive close merge delete

Comments

And what if you simply type soffice? Does LibreOffice start? If not, try to write the full path to the executable (if, of course, it is possible in MacOS).

gabix gravatar imagegabix ( 2019-10-13 08:53:41 +0200 )edit

According to a recent post of @Opaque the command on unixoid systems like MacOS is something like libreoffice6.3 instead of soffice. So it depends on the installed version.

Cookievore gravatar imageCookievore ( 2019-10-13 09:45:19 +0200 )edit

@Cookievore in my openSUSE Leap box, libreoffice starts LibreOffice 6.3 without problems. Maybe it's a bad packaging on a particular distribution?

RGB-es gravatar imageRGB-es ( 2019-10-13 10:52:11 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-10-13 11:14:38 +0200

gtomorrow gravatar image

With macOS you have to point to the binary in the app bundle...

/Applications/LibreOffice.app/Contents/MacOS/soffice --[options] [filename]

Cheers!

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-10-13 02:13:14 +0200

Seen: 36 times

Last updated: 18 hours ago