Batch process files possible on Mac?

I tried batch processing files on the Mac, but since opening a file opens another window, it didn’t work. Does anyone have had succes doing this on the Mac?

1 Like

I would be interested too, I tried this a long time ago and gave up for the same reason…

if you gave up that doesn’t sound hopeful… :smirk:

1 Like

Rhino 6 for Mac allows launching with command-line parameters like -nosplash or modelname.3dm …even -runscript …see: Launching Rhino for Mac with a runscript argument.

I can imagine you could either write a bash script to do this or perhaps even use some combination of Rhino’s macros _Open,_Close, etc. to do this.

I’d be curious to hear where you hit snags.

Note: this was not possible in Rhino 5 for Mac.

On Windows, I can just open Rhino, Open the PythonScript editor and run a script that opens several files in a for loop. Do you mean with the last method in that link (that mentions: for longer loops…) this is the one that does this?

The problem is (in my understanding anyway) that scripts run inside one Rhino “window” on Mac, so when you “Close” that, the script is terminated. Is that not the case?

I guess I don’t know what you want to do.

Something like this? Here’s a bash script that will launch Rhino and do something (in this case something arbitrary) for each 3dm file it finds in a folder…

#!/usr/bin/env bash

  echo "Launching Rhino and opening the $f file..."
  /Applications/ $f -runscript "_Line 0 10,10,10 _Save _Quit"

Sure, these are not running in the same session of Rhino, but neither are they on Windows really.

Think of this like writing a batch (.bat) file on Windows. Bash just runs on nearly all posix systems - now even Windows 10 I believe.

To test the above:

  1. Save the text above as a file somewhere. For example: ~/Desktop/
  2. Create a folder somewhere with test 3dm files to process. Edit and point the FILES_TO_BATH_PROCESS to that path.
  3. Launch /Applications/Utilities/
  4. cd to your ~/Desktop (or wherever you put the script)
  5. Run the script with ./

OK, so there is not a pure Python/rhinoscriptsyntax way to do this from inside Mac Rhino - i.e. just running it from an alias, button or similar…

No, I do not believe so. Now that I see you want to do this from an alias, button, etc, I understand why this is a limitation.