// Demo to use single keystrokes for various non-destructive annotations. // from version 1.47d, commands are forced to be executed via shortcut key only // N. Vischer, 3-oct-2012 macro "Annotate Good [1]"{ annotate("Good", "green"); } macro "Annotate Bad [2]"{ annotate("Bad", "red"); } macro "Annotate Neutral [3]"{ annotate("Neutral", "orange"); } function annotate(str, color) { requires("1.47d"); cmd = getInfo("command.name"); if (!startsWith(cmd, "^")) exit("Command must be invoked via shortcut key, while cursor is at desired position"); getCursorLoc(x, y, z, flags); makeText(str, x, y); run("Properties... ", "stroke=&color font=12"); run("Add Selection..."); run("Select None"); }