// Clock // // This macro demonstrates how to display a // digital clock in a text window. It uses the // Plugins>New>Text Window command to // open a text window without a menu bar. title = "[Clock]"; run("Text Window...", "name="+ title +" width=10 height=1"); getDateAndTime(year, month, week, day, hour, min, sec, msec); start = getTime; while (true) { getDateAndTime(year, month, week, day, hour, min, sec, msec); print(title, "\\Update:"+pad(hour)+":"+pad(min)+":"+pad(sec)); wait(1000); } function pad(n) { n = toString(n); if (lengthOf(n)==1) n = "0"+n; return n; }