Save Selection Script?


hi,

i trying create script pops open "select > save selection" window.

i need work in document , on layer. after researching basic scripting, came across script below, however, throws error, stating semicolon expected?

 

is additional code needed?

any appreciated.

 

thank in advance.

 

var docref = app.activedocument;

var chanref:channel = docref.channels.add();

chanref.name = "new selection";

chanref.kind = channeltype.selectedarea;

docref.selection.store( docref.channels.getbyname("new selection"), selectiontype.extend );

to need use action manager code shows dialog.

 

i save selection in 1 of scripts without  dialog showing here action manager code need turn on dialog

 

function  savealpha(alphaname){

  var iddplc = charidtotypeid( "dplc" );

     var desc27 = new actiondescriptor();

    var idnull = charidtotypeid( "null" );

         var ref11 = new actionreference();

         var idchnl = charidtotypeid( "chnl" );

         var idfsel = charidtotypeid( "fsel" );

         ref11.putproperty( idchnl, idfsel );

     desc27.putreference( idnull, ref11 );

     var idnm = charidtotypeid( "nm  " );

     desc27.putstring( idnm, alphaname );

  try {

  executeaction( iddplc, desc27, dialogmodes.no );

  }

  catch(e) {}

}



More discussions in Photoshop Scripting


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?

Animate - problem with duplicating scripts after loop