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

Get a list of available styles before applying them

Engaged ,
Jul 26, 2019 Jul 26, 2019

Copy link to clipboard

Copied

Hi,

I used screen listener to create a function which applies layer style to a group.

Is there a way to produce a list of all layer styes, currently loaded/existing in the application?

I what to check if the style exist before applying it.

function applyStyleToGroup(style) {

var c2t = function (s) {

return app.charIDToTypeID(s);

};

var s2t = function (s) {

return app.stringIDToTypeID(s);

};

var descriptor = new ActionDescriptor();

var reference = new ActionReference();

var reference2 = new ActionReference();

reference.putName( s2t( "style" ), style);

descriptor.putReference( c2t( "null" ), reference );

reference2.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));

descriptor.putReference( s2t( "to" ), reference2 );

descriptor.putBoolean( s2t( "group" ), true );

executeAction( s2t( "applyStyle" ), descriptor, DialogModes.NO );

}//applyStyleToGroup

TOPICS
Actions and scripting

Views

675

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

correct answers 1 Correct answer

Community Expert , Jul 27, 2019 Jul 27, 2019

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

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
Engaged ,
Aug 08, 2019 Aug 08, 2019

Copy link to clipboard

Copied

Hi,

It working very well.

I create a script and in one of the stages the user can choose to add a layer style by writing the layer style name.

I noticed that it only works for local styles.

Is there a way to apply styles from the user creative cloud library as well?

Dan

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 ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

LATEST

I do not use Adobe Cloud Storage.  I would think a cloud files is a file that is in many places. In Adobe Cloud storage and on users local machine in their shared libraries and these library files are synced by Adobe Cloud software.  To be able to use a cloud style in Photoshop I would believe you would need to load it into you Photoshop style Palette which would add it into your Photoshop Preferences. There it would be useable and more or less static.  If the style is changed in the cloud you would need to delete from your palette and reload the one  from your library. I would think you can use the Preset manager to maintain you Style Platte.  Again I do not use Adobe Cloud Libraries  newer versions of Creative cloud Photoshop version may be able to maintain thing your load from Adobe cloud libraries. 

JJMack

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