try { if ( app.documents.length > 0 ){ // Make sure the is an open document // Create curves adjustment with the curves modal dialog var id240 = charIDToTypeID( "Mk " ); var desc47 = new ActionDescriptor(); var id241 = charIDToTypeID( "null" ); var ref31 = new ActionReference(); var id242 = stringIDToTypeID( "contentLayer" ); ref31.putClass( id242 ); desc47.putReference( id241, ref31 ); var id243 = charIDToTypeID( "Usng" ); var desc48 = new ActionDescriptor(); var id244 = charIDToTypeID( "Type" ); var id245 = charIDToTypeID( "Crvs" ); desc48.putClass( id244, id245 ); var id246 = stringIDToTypeID( "contentLayer" ); desc47.putObject( id243, id246, desc48 ); executeAction( id240, desc47, DialogModes.ALL ); } } catch(e){ //catch any errors }