Skip to main content
Participant
February 17, 2024
Question

Help! Error 45: Object is invalid

  • February 17, 2024
  • 1 reply
  • 239 views

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?
 
This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

femkeblanco
Legend
February 18, 2024

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