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

How Set Layer Style parameters like visible in Scripts

Community Beginner ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

How I set Layer Style(FX) visiblity False and True
It seems simple, but it's so difficult Plz help

 

It is implemented in a Python environment (Photoshop API)

 

Javascript doesn't matter either

TOPICS
Actions and scripting , SDK , Windows

Views

203

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 ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

I found a solution by myself

 

function cTID(s) {
    return app.charIDToTypeID(s);
}

var desc = new ActionDescriptor();
var list = new ActionList();
var ref = new ActionReference();
ref.putClass(cTID('Lefx'));
ref.putEnumerated(cTID("Lyr "), cTID("Ordn"), cTID("Trgt"));
list.putReference(ref);
desc.putList(cTID('null'), list);
// Hide
executeAction(cTID('Hd  '), desc, DialogModes.NO);

or
// Show
executeAction(cTID('Shw '), desc, DialogModes.NO);

 

 

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
Community Expert ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

Looks like JavaScript to me. 

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
Community Beginner ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

If you want to use it in python photoshop api
almost the same

 

js = """
function cTID(s) {
return app.charIDToTypeID(s);
}

var desc = new ActionDescriptor();
var list = new ActionList();
var ref = new ActionReference();
ref.putClass(cTID('Lefx'));
ref.putEnumerated(cTID("Lyr "), cTID("Ordn"), cTID("Trgt"));
list.putReference(ref);
desc.putList(cTID('null'), list);
// Hide
executeAction(cTID('Hd '), desc, DialogModes.NO);
or
// Show
// executeAction(cTID('Shw '), desc, DialogModes.NO);
"""

ps.app.doJavaScript(js)

 

 

 

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
Community Expert ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

quote
If you want to use it in python photoshop api

Why would I want to do that? 

 

You stated »Javascript doesn't matter either« in your original post, so what did you mean by that?  

 

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
Community Beginner ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

I think it's a translator error
I mean, it's okay to do it in JavaScript

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
Community Expert ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

LATEST

Thanks; yeah, Auto-translation can be less than perfect. 

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