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

Array is not amending text name

Contributor ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

I have this script, I am trying to create a generated alphabet on new text items, however I get the error that "required value is missing".

I feel it is something obvious, but I am stumped.

#target Photoshop

var abc = new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");

  for (i < 0; abc.length; i++){

    var al = app.activeDocument.artLayers.add ();

    al.kind = LayerKind.TEXT;

    al.name = abc

    al.textItem.font = "ArialMT"

    al.textItem.size = 1200

    al.textItem.contents = abc

  

}

TOPICS
Actions and scripting

Views

1.8K

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

People's Champ , Nov 20, 2018 Nov 20, 2018

for (i = 0; i < abc.length; i++)

Votes

Translate

Translate
Adobe
Community Expert ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Try

  for (i < 0; i < abc.length; i++){

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
Contributor ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Sadly no joy.

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 ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Open a document 2500px by 2500px add positoin to your text layer also.

#target Photoshop

var abc = new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");

for (i < 0; i < abc.length; i++){

    var al = app.activeDocument.artLayers.add ();

    al.kind = LayerKind.TEXT;

    al.name = abc

    al.textItem.font = "ArialMT"

    al.textItem.size = 1200

    al.textItem.position = Array(500, 1800 );

    al.textItem.contents = abc

}

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
Community Expert ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

abc.gif

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
Contributor ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Copied your code word for word to remove chance of error.

I still get the below:

Screen Shot 2018-11-20 at 15.12.30.png

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 ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Perhaps its a bug in Adobe ExtendScript.  I do not use that Just save that code  as test.jsx and run it in Photoshop however, it most likely is you have no open document you need one to use that script.  Otherwise the no document to add the text layer to.

with no open document active you will get

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
Contributor ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Running via Photoshop throws up the same error via Error dialog.

Screen Shot 2018-11-20 at 16.03.30.png

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
Contributor ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Not sure, if related, but I have also been getting this on a few scripts today:

Screen Shot 2018-11-20 at 16.06.25.png

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
People's Champ ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

read post #3

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
Contributor ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Haha r-bin, I am so sorry. I literally thought you had the same comment as JJ and that you'd both just commented at the same time.

That indeed was the solution. Cheers.

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 ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

LATEST

In the Extendscript you show that line as line 6 not 7 did you add a statement?

Screen+Shot+2018-11-20+at+15.12.30.png

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
People's Champ ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

for (i = 0; i < abc.length; i++)

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