Undefined variable or class name: gui

Hi there
I’m a total newby to micromanager. I’m using it to run scripts for image acquisition. The scripts I have in hand use gui objects, but micromanager doesn’t want to play.
Even for a very simple script

gui.clearMessageWindow();
gui.message(“Hello”);

I get the following message:
Line 1: evaluation error : Sourced file: inline evaluation of: ``gui.clearMessageWindow(); gui.message(“Hello”);’’ : Attempt to resolve method: clearMessageWindow() on undefined variable or class name: gui

I bet this is a pretty fundamental problem, but I’m at a loss.
(I’m not having any trouble scripting mmc objects)

Cheers
Mike

Hi Mike,

I had issues when I was just starting out where the gui or mmc variables get overwritten. Do you get the errors after a bit of fiddling around? If so try just restarting micro-manager.

Hello Mike,

Which version of micromanager are you using?

for micromanager gamma,
use, mm.getScriptController().clearMessageWindow();
mm.scripter().message(“Hello”);

Hope his helps.
Cheers,
Amit

Thanks, Amit.

Indeed the issue was that I was working from scripts written for 1.4 but am using 2.0

Cheers
Mike

Hi Amit
I got the same problem as Mike had, and the new code didn’t work as well. I got this message with the new code:
Line -1: evaluation error : Sourced file: inline evaluation of: ``mm.getScriptController().clearMessageWindow(); mm.scripter().message(“Hello”);’’ Token Parsing Error: Lexical error at line 2, column 23. Encountered: “\u201c” (8220), after : “”

would you please let me know what could be the reason?

Make sure you use the right quote symbol. The website makes fancy quotes, but you need simple ones. Try the following:

mm.getScriptController().clearMessageWindow();
mm.scripter().message("Hello")

Thanks Nico, this one worked. Could you please tell why I get error for all of the command that start with gui. ? Is there any place where I can look up and learn how to edit the gui. commands in general??

There is no gui in 2.0. gui is the name of the MMStudio object in 1.4. It simply does not exist in 2.0. The API (and names of variables changed between 1.4 and 2.0. See: Version 2.0 - Micro-Manager

Thank you very much, and I’d like to learn more about how to import different packages and which one I should import (the section that we write at the beginning of the scripts). Is there any documentation or a tutorial you can suggest?