Is there support for RunScript on the Mac? I gave it a try with the following:
cd /Applications/Rhinoceros.app/Contents/MacOS
./Rhinoceros runscript="_RunPythonScript"
…which resulted in Rhino believing it had been instructed to open a file. Changing runscript to --runscript opened Rhino silently, i.e. no errors but no script/command run as far as I can tell.
Incidentally, launching the executable from the shell yields this line as its first output before dropping me into the ST-DEVELOPER copyright and program output:
RunScript support would be very exciting because given enough control over Rhino from the Python api, one could wrap program configuration, plugins, etc. into one script which looks just like a native .app– easy to launch and quicker than prompting for a script to run after opening a new document and after calling RunPythonScript.
There is no support for command line options in Rhino for Mac. Rhino for Windows lets you specify commands to be run when Rhino starts, but this is not implemented yet on the Mac.
Is there any other way to automate the running of a Python script in Rhino for Mac? It’d seem that the StartAtomEditorListener command that the rhino-python Atom plugin uses would be a good place to start. Anyone looked into this or have any work-arounds?
In order to RunPythonScript using the new listener, you need two things:
To run StartAtomEditorListener in Rhino
To send a request to Rhino containing your script
The request is easy enough. Here’s a minimal example with curl:
curl -X POST -d '{"FileName":"/path/to/script.py"}' http://localhost:8080/runpythonscriptfile --ipv4
However, we still need some way to run a Rhino command on startup. I can think of some hack-ish solutions, but nothing that I’d really want to use. There are a number of GUI automation tools such as Sikuli or maybe even AppleScript– you could create a keyboard macro to run either the listener or your command directly.
you can also make a macro in rhino which runs all your various start up commands… i have one which i use when launching rhino which starts atom listener, changes points to round, and volume to cubic yards… just one key then return.