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

Array is not amending text name

Contributor ,
Nov 20, 2018 Nov 20, 2018

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
2.2K
Translate
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++)

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

Try

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

JJMack
Translate
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

Sadly no joy.

Translate
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

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
Translate
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

abc.gif

JJMack
Translate
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

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

Translate
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

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
Translate
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

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

Screen Shot 2018-11-20 at 16.03.30.png

Translate
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

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

Translate
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

read post #3

Translate
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

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.

Translate
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
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
Translate
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

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

Translate
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