AttributeError:object has no attribute 'gui'

I am using a user library to call all the tag change scripts. I want a messageBox to be displayed on the vision module. When I call system.gui.messageBox(‘xyz’) I get this error:AttributeError: ‘com.inductiveautomation.ignition.common.script.Imm’ object has no attribute ‘gui’

I can see all the other lines of code from the imported library process just fine.
I did import system.
Thanks in advance!

You can’t open a message box or interact with the GUI from tag change scripts, they are running on the gateway and not any particular client or designer.

This always trips me up in perspective and using the script console so I wrote a utility function to switch between them depending on if the perspective name space is available. Perhaps you can do the same for the gui name space:

def Print(Message):
	if hasattr('system', 'perspective'):
		print Message