mm.getCore().snapImage() no longer working?

Hi. After a recently upgrade (to 2021-5-17 and 2021-5-18), one of my home-brew plugins that had been working fine for some time stopped working, and when I ran my BeanShell script version, I got the error " Error in method invocation: Method getCore() not found in class’org.micromanager.internal.MMStudio’ "

I get the same error in the included example script ‘acqMissingFrames.bsh’, so I’m wondering if acquiring images using 'mm.getCore().snapImage() is deprecated? Other example scripts that snap images work, and both my scripts and ‘acqMissingFrames.bsh’ work fine on older versions of MM (I just tried a random mid-2020 one to make sure). Should I be doing this differently, or are the examples out of date? Thanks for any help anyone can provide.

Welcome to this forum @hamehaf!

There has been some code cleanup, and some function names may have changed. It is always best to look at the (current) documentation for Studio: Studio and the Core: CMMCore. In the Beanshell script environment, you get the core for free: mmc, or get it with mm.core(). mmc.snapImage() should work fine. We clearly need to update all the scripts that are included (I remember doing that ones, but may have missed some, will have a look at that).

Fantastic. Thanks so much for your help. I’ll have a look through the current docs. Thanks again!

1 Like