I would have thought that Stringbox would return None if you hit the cancel button. However, what I found is that it returns an empty string "", which is not None. Is this normal behavior? Its vbRhinoscript companion returns Null when you hit cancel.
import rhinoscriptsyntax as rsnewName=rs.StringBox("Hit the cancel button","blabla","Stringbox")if newName is None: print "None returned"if newName == "": print "Empty string returned"else: print "Something is wrong"