Skip to main content
Known Participant
September 24, 2021
Question

To apply World -Ready layout & Diacritics through scripting or Action Manager Code

  • September 24, 2021
  • 2 replies
  • 8500 views

 

Hi All,

 

I have checked the Photoshop Object model for apply "World_ready layout " to all text layers in the .psd files, but I can't find any possibilites over there. Is it possible via Action manager code or scripting and also I want to apply Horizontal and Vertical Diacritics to be set to 0.

 

 

This topic has been closed for replies.

2 replies

Participating Frequently
March 30, 2024

I as able to get the code functions via ScriptingListener. Here is code for applying "World Ready Layout" & "Latin and East-Asian Layout":

setWorldReadyLayout();

function setWorldReadyLayout() {
  var descriptor = new ActionDescriptor();
  var descriptor2 = new ActionDescriptor();
  var reference = new ActionReference();

  reference.putProperty( stringIDToTypeID( "property" ), stringIDToTypeID( "paragraphStyle" ));
  reference.putEnumerated( stringIDToTypeID( "textLayer" ), stringIDToTypeID( "ordinal" ), stringIDToTypeID( "targetEnum" ));
  descriptor.putReference( stringIDToTypeID( "null" ), reference );
  descriptor2.putEnumerated( stringIDToTypeID( "textComposerEngine" ), stringIDToTypeID( "textComposerEngine" ), stringIDToTypeID( "textOptycaComposer" )); // World-Ready Layout code
  descriptor.putObject( stringIDToTypeID( "to" ), stringIDToTypeID( "paragraphStyle" ), descriptor2 );
  executeAction( stringIDToTypeID( "set" ), descriptor, DialogModes.NO );
}

setLEALayout();

function setLEALayout() {
  var descriptor = new ActionDescriptor();
  var descriptor2 = new ActionDescriptor();
  var reference = new ActionReference();

  reference.putProperty( stringIDToTypeID( "property" ), stringIDToTypeID( "paragraphStyle" ));
  reference.putEnumerated( stringIDToTypeID( "textLayer" ), stringIDToTypeID( "ordinal" ), stringIDToTypeID( "targetEnum" ));
  descriptor.putReference( stringIDToTypeID( "null" ), reference );
  descriptor2.putEnumerated( stringIDToTypeID( "textComposerEngine" ), stringIDToTypeID( "textComposerEngine" ), stringIDToTypeID( "textLatinCJKComposer" )); // Latin and East-Asian Layout code
  descriptor.putObject( stringIDToTypeID( "to" ), stringIDToTypeID( "paragraphStyle" ), descriptor2 );
  executeAction( stringIDToTypeID( "set" ), descriptor, DialogModes.NO );
}
Participant
July 1, 2024

how to use this code 

 

Known Participant
September 24, 2021

Hi All,

 

Is there any way to enable the world-ready layout in the photoshop document via any scripting language

JJMack
Community Expert
Community Expert
September 24, 2021

Try setting up a Text Tool Preset with that option set and select that preset in your script after activating the text tool it should work.

 

Script and actions can do very little when it come to setting  Photoshop UI options.  

JJMack
Rocky@Author
Known Participant
September 24, 2021

Thanks Mack. Could you please explain in detail how to append the "world-ready layout" option in tool preset? and this new approach for me.