Hi, did you try your script without the try block? It just means it catches some exception but nevertheless nuke was able to open the script and there is no reason to not continue.
Best regards, Michael Jep Hill <[email protected]> wrote: >Ok, I probably could have worded my last post a bit better and provided >an actual python test since, after all, this is a PYTHON board. Here's >a bit more info to shed light on my issue: > >I have a script that is pointing to some missing media and missing >gizmos -- so I expect warnings and errors. When I do the following, I >am able to open it via a shell interactive prompt and work with it: > >nuke -t >nuke.scriptOpen("myNukeScript.nk") > >Even though there are warnings/errors about missing image sequences, it >does allow me to continue on in interactive mode... > >However, if make a simple python function named openTest.py: > >### openTest.py > >import nuke >import os > > >def main(): > nk = os.path.abspath(sys.argv[1]) > try: > nuke.scriptOpen(nk) > except: > print "Unable to open file" > else: > ### do stuff to script... > >if __name__ == '__main__': > main() > >### end > > >then execute it as such: > >nuke -t openTest.py myNukeScript.nk > >I hit the the exception and get my message: "Unable to open file" > >Question: How can I get the script to Open via python so I can continue >to do things to it? > > >If it opens in my first example, it should absolutely open in the >second... Thoughts? > > >Cheers, >Jep_______________________________________________ >Nuke-python mailing list >[email protected], http://forums.thefoundry.co.uk/ >http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python -- Sent from my Android tab with K-9 Mail. Please excuse my brevity. _______________________________________________ Nuke-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
