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

Test for Layer Effects applied to a layer

Community Beginner ,
Jan 16, 2018 Jan 16, 2018

Copy link to clipboard

Copied

I have a pretty complicated script I've been working on but coming up against an issue.

There is a portion of it I want to run only if a selected layer has Layer Effects applied to it. I have been searching all over this forum and haven't found the answer other than someone stating that it's possible. How does one detect Layer Effects?

Any help would be greatly appreciated.

TOPICS
Actions and scripting

Views

467

Translate

Translate

Report

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 Beginner ,
Jan 16, 2018 Jan 16, 2018

Copy link to clipboard

Copied

I know there is a command to Copy Layer Effects "CpFX" that will fail the JS if the layer has no Effects applied to it. Is there some way to just test if the command is available?

Votes

Translate

Translate

Report

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
LEGEND ,
Jan 16, 2018 Jan 16, 2018

Copy link to clipboard

Copied

function sTT(v) {return stringIDToTypeID(v)}

(ref = new ActionReference()).putEnumerated(sTT('layer'), sTT('ordinal'),

sTT('targetEnum')), executeActionGet(ref).hasKey(sTT('layerEffects'))

Votes

Translate

Translate

Report

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
People's Champ ,
Jan 17, 2018 Jan 17, 2018

Copy link to clipboard

Copied

LATEST

The presence of the layerEffects key is possible even when the layer does not have standard blending options, but there are no effects. The following function can help. It checks the availability of the scaleEffectsEvent command.

function has_visible_effects()

    {

    try {

        executeAction( stringIDToTypeID( "scaleEffectsEvent" ), undefined, DialogModes.NO );

        return true;

        }

    catch (e) { return false; }

    }

Votes

Translate

Translate

Report

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
Enthusiast ,
Jan 16, 2018 Jan 16, 2018

Copy link to clipboard

Copied

You can check my script "clear hidden effects" Magic scripts for Photoshop

There is a lot things about effects.

Votes

Translate

Translate

Report

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