Skip to main content
Participant
January 17, 2020
Question

TextEdit to Photoshop layer names to Image Processor

  • January 17, 2020
  • 3 replies
  • 891 views

Hello community of wise men and women,

I have a daily workflow which is very complex.

I would like to script some, if not all of its steps.

I begin duplicating a tif file layer in photoshop (der0201nrr.tif)

The 15 layers are then renamed by copy/paste from TextEdit with

the code recognizable by image processor ex: 650x? xp_60176002_der0201nrr_dv80.jpg10

As my assest are generated beautifully by processor, which I batch process, I then have to move EACH asset to a unique corresponding folder. This task is repeated daily a thousand times...!

Is there a script someone can point me to that would take the TextEdit list of 15 layer names and populate it automatically to avoid to cut and paste between TextEdit and Photoshop?

Or even more Idyllic, is there a batch process that can generate assets with unique subdirectories?

 

Hopefully what I am asking makes sense...

I will be willing to reformulate the question, if necessary.

FreddieMac

This topic has been closed for replies.

3 replies

Inspiring
January 19, 2020

Like this?

 

 

 

This will take the text from the front document of TextEdit and rename the layers.

 

tell application "TextEdit"

          set Alltext to get text of document 1

          set oldDelimiters to AppleScript's text item delimiters

          set AppleScript's text item delimiters to linefeed

          set getName to every text item of Alltext

          set AppleScript's text item delimiters to ","

          set NewText to getName

          set AppleScript's text item delimiters to oldDelimiters

          set CountAllText to count of NewText

end tell

tell application id "com.adobe.Photoshop"

          set GetAllLayers to every layer of current document

          set CountAllLayers to (count of every layer of current document) - 1

          if CountAllLayers is equal to CountAllText then

                   repeat with i from 1 to CountAllText

                             tell (item i of GetAllLayers) to set name to (item i of NewText)

                   end repeat

          else

                   display dialog "Make sure you have duplicated " & CountAllText & " layers!"

          end if

end tell

 

Legend
January 20, 2020

Yes. I typically use JavaScript for Adobe scripts, haven't written any AppleScripts in ages but either one works.

Legend
January 17, 2020

It might be easier to write a Bridge script to move and rename files after export. Since you are on a Mac, you could use Automator to create a watched folder and do it automatically.

c.pfaffenbichler
Community Expert
Community Expert
January 17, 2020

I don’t think I quite understand. 

Could you post a screenshot of an image with the intended Layers and the Layers Pane visible? 

Do all the Layers have the identical content? 

Participant
January 18, 2020

Participant
January 18, 2020

The 2 pngs uploaded contain the list of filenames for the asssets at different jpg size.

The image is the same for all except different sizes.

The list could potentially grow to 30 assets at which I hope I can have a script.

Basically, as I explained earlier, the tiff file is layer duplicated in photoshop 15 times,

then the layers are renamed and image processed into a single assets folder which then gets distributed to unique folder locations.

If I could just have a script that automatically grabs the layer names in one step?