Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

load layer as an selection

New Here ,
Aug 23, 2013 Aug 23, 2013

Is it possible in Applescript or JavaScript to load a layer as an selection, the way you do manually with

pressing-and-hold the Command (PC: Ctrl) key and click on the layer's thumbnail?

TOPICS
Actions and scripting
437
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guru ,
Aug 23, 2013 Aug 23, 2013
LATEST

Here is the javascript version.

function loadLayerTransparencyToSelection() {

    var desc = new ActionDescriptor();

        var ref = new ActionReference();

        ref.putProperty( charIDToTypeID('Chnl'), charIDToTypeID('fsel') );

    desc.putReference( charIDToTypeID('null'), ref );

        var ref = new ActionReference();

        ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Trsp') );

    desc.putReference( charIDToTypeID('T   '), ref );

    executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );

};

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines