2

I'd like to run OpenSCAD from the command line with some arguments.

$ open -a openscad myfile.scad

works as I expect.

$ open -a openscad --args --help

reports

LSOpenURLsWithRole() failed for the application /Applications/OpenSCAD.app with error -10810.

when OpenSCAD is not already running. When OpenSCAD is already running, then open -a openscad --args --help simply brings OpenSCAD to the foreground.

What I really need is for this to work:

$ open -a openscad --args -o myfile.stl myfile.scad

which works just like my previous example. What should I do to launch OpenSCAD with command line arguments?

Before hitting submit I reproduced my questions for pasting here, and I found a solution that more-or-less works. All of these seem to do what I expect, even if OpenSCAD is not already running.

$ /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD --help
$ /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD --args --help
$ /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD -o ball.stl ball.scad
$ /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD --args -o ball.stl ball.scad

Still, is there a way to make open -a pass command line arguments to the app it launches?

  • I don't have openscad. But have you tried to open -a openscad --args '--help' or open -a openscad --args "--help" – markhunte Mar 8 '15 at 20:54
  • I didn't see change in behaviour by adding quotes. – John Schmitt Mar 8 '15 at 22:14
1

The only thing I can get to work is opening a file. It seems that the App is not made to accept the args this way.

open -a openscad --args '/path/to/foo.scad'

The App does have an Applescript scripting definition but it only has reload defined.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .