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

Select channel by action script not working.

New Here ,
Dec 16, 2015 Dec 16, 2015

Hi, I'm trying to select a transparency channel through the use of an action script and I keep getting an error that says, "The object "channel "Transparency"" is not currently available." There is clearly a Transparency channel but it doesn't seem to be grabbing it.

Is there another way around this issue?

Any help would be much appreciated.

Thank you!

TOPICS
Actions and scripting
1.0K
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
Community Expert ,
Dec 16, 2015 Dec 16, 2015

When this happens what kind of layer is the active layer and is only one layer active? And the background layer does not support transparency/

JJMack
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
New Here ,
Dec 17, 2015 Dec 17, 2015

Hi JJMack. It's simply unable to grab a hold on the transparency channel. I've tried selecting all layers, the main group, selecting nothing and it doesn't work.

I did however find a piece of Javascript code that helped me accomplish it but I would ideally like to do this through ActionScript. Do you know how to convert Javascript to ActionScript? It's my understanding that it is possible?

If I can convert this it would be great:

// remove every but the composite channels,

if (documents.length > 0)

{

docRef = activeDocument;

for (var i:var= docRef.channels.length-1; i >=0; i--) {

if (docRef.channels.kind != ChannelType.COMPONENT) {

$.writeln(docRef.channels.kind);

docRef.channels.remove(); }

}

}

else

{

alert("There must be at least one open document to run this script!");

}

Cheers!

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
Community Expert ,
Dec 17, 2015 Dec 17, 2015

If you want an ActionScript you should ask in the following forums

ActionScript 1 and 2

ActionScript 3

JJMack
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
Community Expert ,
Dec 18, 2015 Dec 18, 2015

I'm trying to select a transparency channel

What do you mean by that?

The transparency of a Layer as a Selection, a Layer Mask, …?

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
Community Expert ,
Dec 18, 2015 Dec 18, 2015
LATEST

If you are recording a Photoshop ACTION (.atn), then target the layer containing transparency in your action. This step should be recorded in your action as either the targeting of an absolute layer name or a relative layer name if you wish to automate this, otherwise you can set a manual stop in the action and then replay the action once the user has manually targeted the appropriate channel.

Finally you would hold down the Command (Mac) or Control (Windows) key while clicking on the layer thumbnail in the layers palette. This step would then be recorded in the action as “set selection to transparency channel”.

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