The rhino-python package for the Atom text editor and Rhino for Mac

that’s sort of what i was doing before… or, i had a few macros which would run specific scripts and i’d keep those scripts strictly for writing with then duplicate/save as their actual name once completed… the thing i maybe like most about this atom listener thing is that you don’t have to tell rhino which exact script to run… it will simply run whichever file is active in atom.


anyway, here’s my setup right now.

in Atom, i’ve assigned ⌘R to ‘saveAndRunInRhino’ by editing the keymap.cson file (as shown earlier in the thread)

…so if i’m in Atom, i push ⌘R and the current script saves then runs in rhino.



in automator.app, start a new document and choose Service as the type:



then build the service as seen below:

  1. the service is to receive no input and only for the application rhinoceros

  2. for the action, use Run AppleScript and enter the code shown in the picture…

all it’s doing is telling Atom to come to the front then it keystrokes ⌘R (which is the keystroke i set for saveAndRunInRhino)… so when i run this service from rhino, it switches to atom, saves the current file, then runs it in rhino… it may be disorienting with the quick app switching that is happening but if your display is large enough to fit atom next to rhino instead of on top of it, you’ll barely notice the switching…



i saved the Service as to_Atom and that now shows up in the rhino services menu (you need the latest mac rhino to do this (5A683)+



you’ll see the service also has a keystroke ⌘R assigned which is done in System Preferences-> Keyboard-> Shortcuts-> App Shortcuts



so now, i can press ⌘R in either rhino or atom… in either instance, the current python file in atom will run in rhino and any saving that may be needed will be done automatically…

in the future, if a re-run Python script is added to rhino, this might be a little less confusing to get working this way (using the atom package which saves the file when atom loses focus)

1 Like