Customized Message Box - Vision

Yes. Say you have a project library named projectScripts, and in projectScripts, you have your disposeDialog definition:
image

For this script to work, the definition is going to need to pass in the variable (self), so the prefix for the definition would have to be changed from def disposeDialog(): to def disposeDialog(self):

Then, when you call the function, you will need to pass your source into the definition. For example, if I were to call the definition from the actionPerformed script on a button, the code would look like this: projectScripts.disposeDialog(event.source)

Putting it all together for this usage case, the first 5 rungs of the definition in the project library should look this:

def disposeDialog(self):
	def closeWindow():
		from javax.swing import SwingUtilities
		parent = SwingUtilities.getRoot(self)
		getWindows = parent.getWindows()