0

I am writing a code to automate making around 100 graphics. I am trying to write it so I do not have to do any fine tuning after running the script. I do not know how to handle adjusting single characters in a text layer though. Here is an example of what I am trying to accomplish. It is for having a last name on the back of a football jersey.

One if statement I want to make is if the last name starts with "Mc" to change the "c" to small caps. I figured the code should start like this, but not sure how to call on just the second character to make that small caps:

if (variable.startsWith("Mc"){

This would be for instance if the name is "McDonald" to have the "c" as small caps.

Thanks. Sorry I am fairly new to photoshop scripting and have been doing just the simple things. This is by far the most advanced I have done. Let me know if I need to provide anything else.

  • To my knowledge it's not possible to set two fonts or text options with DOM (textItem). What you need is to dive into AM code where Photoshop divides all text styles into separate blocks (some starting points: https://forums.adobe.com/thread/1175041) – Sergey Kritskiy Nov 27 '18 at 20:03
  • I don't know if there is a way to manipulate text as such with Scripting. I tried to do a similar thing with **bold** words but with no success. However in this instance, as hey are names, it's best to scrutinise the list as the source and get that correct that rather than rely on any technical manipulation thereafter. – Ghoul Fool Feb 11 '19 at 20:02

0 Answers0