Site logo

Uncategorized

Function Hypotenuse

alert(Hypotenuse(1, 2));

function Hypotenuse(a, b) {
   function square(x) { return x*x; }
   return Math.sqrt(square(a) + square(b));
}

[CS4/JS] Pnglib.jsx -- A PNG creator function by Jongware

Function setTimeout

The source is here. A setTimeout function implementation for InDesign ExtendScript like known from a Browser's Javascript. Uses InDesign's idleTask stuff. Timeout milliseconds are not accurate, but it allows to call a heavy load script, split it up into small junks for InDesign is not blocked too long and has time to breath.