Tips for Making Python Scripts and ETO Forms Compatible with Macs

I don’t have a Mac, so this has been challenging, but I seem to have finally conquered this. I had a person just today who successfully installed and used my kit. (To clarify, my kit is not a true plug-in. So, by “install” I mean they ran my own “installation script” which unzips the kit, creates the aliases, and opens the toolbar.)

But here’s four things that seemed to be key in making the forms and scripts work on Macs.

  1. :x: Don’t detect disk drives. Let the user select a folder with rs.BrowseForFolder() instead.
  2. :x: Don’t use the backwards slash character (\) to build paths. Use os.path.join() instead.
  3. :white_check_mark: Do set the DefaultButton property on dialogs.
  4. :white_check_mark: Do enclose the script’s path in double quotes in aliases.

Of course, I’m not great at this stuff. Very self-taught. So I might be misunderstanding something here, but those things seemed to work for me (finally…it took close to a year I think before I got it to work on Macs).

So I wanted to offer people the opportunity to clarify any of my “tips” if necessary and also give people a chance to offer other tips they may have encountered for making Mac-compatible scripts and forms.

(Edit)
Also I use python 2 to be compatible with Rhino 6 and 7…if that makes any differences.

2 Likes

Thanks for sharing your experiences and insights @webdunce!

1 Like