Posted by
Cammer, Michael-3 on
Dec 16, 2020; 2:44pm
URL: http://imagej.273.s1.nabble.com/calling-macros-or-functions-from-within-a-macro-tp5024276.html
I would like to use the pull down menu to run a macro that is in the same text file or a function in the same file. runMacro() requires a file on disk and trying to call a function I defined returns an error message.
For instance, based on
https://imagej.nih.gov/ij/macros/CustomPopupMenu.txt, I tried the following with my function testPulldownMenu(). The other commands in the list are mostly macros in the same file. And the B&C commands works fine.
Is there a way to call my own functions or macros? Any help greatly appreciated.
var pmCmds = newMenu("Popup Menu",
newArray("testPulldownMenu", "Prepare image for markup", "Mark Distal", "Mark Nucleus", "Add Line Segment", "Grays LUT", "Color LUT",
"Brightness/Contrast..."));
macro "Popup Menu" {
cmd = getArgument();
run(cmd);
//runMacro(cmd);
}
function testPulldownMenu() {
print("successful");
}
Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY 10016
[hidden email]<mailto:
[hidden email]>
http://nyulmc.org/micros http://microscopynotes.com/Voice direct only, no text or messages: 1-914-309-3270 and 1-646-501-0567
------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html