oh… something else i found out with Xcode that’s pretty sweet…
you don’t even have to do what i showed in the video in order to get easier testing abilities… with xcode/python/rhino, you can have an open & unsaved document and the unsaved contents will be read when you run the script in rhino…
for example-> this works:
• make a blank python file (example.py) and place it in your rhino scripts folder
• open example.py in xCode
• type print "hello rhino
" (do not save*)
• in rhino, use RunPythonScript
then choose example.py
• “hello rhino” will be returned in rhino
*you can save if you want… just sayin, you don’t have to.
then you can go back to xcode, type some more stuff, not save, run the script in rhino again and the updates are read… it’s reading the unsaved file.
if you put a keyboard shortcut (like ⌘R) to ! -_RunPythonScript example
, it becomes even easier to test the script.
or, the setup i’m using is with the service as outlined in the video in xcode… when set up this way, you can run the script from either rhino OR xcode… ⌘R in either application will trigger the script to run in the exact state it’s in… so, you don’t have to worry about which app has focus at the time of activating the script… honestly, it almost feels like you’re only in rhino when set up this way.
i tried it in quite a few editors and none worked this way except xcode… the only one which comes close is Chocolat which has the following preference setting:
so with that, you can type in the .py… then go to rhino-> activate the script and it will work since when you switched to rhino, the file saved automatically.
EDIT-- oh, i get it that if you’re on windows, this stuff probably seems a bit backwards and/or worse… but, if you’re on mac, it’s actually moving forward because at first glance, writing scripts on mac is pretty bad
…these little tricks make it easier for now.