// Try Catch examples // This example shows how to use try catch blocks // To Use: // set exampleToRun to 1 // Reset Photoshop preferences // Restart photoshop // increment this value and run again to see each example in turn var exampleToRun = 1; try { switch ( exampleToRun ) { case 1: documents.add( 1000, 1000 ); break; case 2: app.preferences.rulerUnits = Units.PIXELS; documents.add( 1000, 1000 ); break; case 3: app.preferences.rulerUnits = Units.INCHES; documents.add( UnitValue(1000, "px"), UnitValue(1000, "px") ); break; default: alert( 'bad exampleToRun ' + exampleToRun ); break; } } catch(e) { alert( e + ":" + e.line ); } // should I show what happens when you drop a break ??