#NEWLINE# def saveAs( menu ) : #NEWLINE# #INDENT# scriptWindow = menu . ancestor ( GafferUI . ScriptWindow ) #NEWLINE# script = scriptWindow . scriptNode ( ) #NEWLINE# ( path , bookmarks ) = __pathAndBookmarks ( scriptWindow ) #NEWLINE# dialogue = GafferUI . PathChooserDialogue ( path , title = 'Save script' , confirmLabel = 'Save' , leaf = True , bookmarks = bookmarks ) #NEWLINE# path = dialogue . waitForPath ( parentWindow = scriptWindow ) #NEWLINE# if ( not path ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# path = str ( dialogue ) #NEWLINE# if ( not path . endswith ( '.gfr' ) ) : #NEWLINE# #INDENT# path += '.gfr' #NEWLINE# #UNINDENT# script [ 'fileName' ] . setValue ( path ) #NEWLINE# with GafferUI . ErrorDialogue . ExceptionHandler ( title = 'Error Saving File' , parentWindow = scriptWindow ) : #NEWLINE# #INDENT# script . save ( ) #NEWLINE# #UNINDENT# application = script . ancestor ( Gaffer . ApplicationRoot ) #NEWLINE# addRecentFile ( application , path )