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

Help! Error 45: Object is invalid

New Here ,
Feb 17, 2024 Feb 17, 2024

Copy link to clipboard

Copied

I have a number of .eps files I want to save .ai and make some changes in files. One of them is to create the main layer and put all other layers as sublayers of the main and give to main layer the name of the  eps file without extension.  I so also this name as text in one of the layers. So, I tried two options:

 

1-

var FigureNumber = newLayer5.textFrames;
var FigureNumberText = FigureNumber[0].contents;
MainLayer.name = FigureNumberText;  
2-
var MainLayer = doc.layers.add();
   MainLayer.name = doc.name.replace(/\.[^\.]*$/, "");
 
on the third file, I get this error in "MainLayer.name = FigureNumberText;" or "MainLayer.name = doc.name.replace(/\.[^\.]*$/, "");"  , with the two first files it's working well.
 
Any help, please?
 
TOPICS
Import and export , Scripting

Views

167
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
Adobe
Guide ,
Feb 18, 2024 Feb 18, 2024

Copy link to clipboard

Copied

LATEST

Without a runnable snippet of code and the file causing the error, your chances of an answer are slim.

Votes

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