Skip to main content
New Participant
February 25, 2016
Question

Internal error creating CSS: undefined is not an object at script line 970

  • February 25, 2016
  • 2 replies
  • 1943 views

When trying to copy css from a layer I get

Internal error creating CSS: undefined is not an object at script line 970

I have updated to the most recent version. I am on a Mac using the most recent version of the system software. The PSD file was created by another person and sent to me.

This topic has been closed for replies.

2 replies

JJMack
Braniac
June 4, 2016

Does it fail on all layers or just the ones that have gradients?

JJMack
New Participant
June 11, 2018

For me it fails only on gradient layer

New Participant
December 21, 2020

Hi,

I have the same error. I am also tried to export css of gradient. I work olso from mac, Photoshop 2021

 

New Participant
June 3, 2016

Has anyone found an answer for this?

JJMack
Braniac
June 4, 2016

I do not do Web stuff.  From what I read Copy CSS should copy to the clipboard CSS code requires for text layers, Shape and Groups that you can then pasted into your style sheet document.  The script that is failing on you is most likely "CopyCSSToClipboard.jsx" in Photoshop required folder. I use windows yor Mac script and its location may different from my windows version.  When I try to use copy css on text and shape layers I do not find any text in my Windows clipboard. I do not know or care if that not working correctly on my machine for I do for create CSS documents.

On windows CC 2015 line 970 is:

if (matteStops.location == colorStops.location)

that is in the function starting on line 879

// Gradient format: linear-gradient( <angle>, rgb( rr, gg, bb ) xx%, rgb( rr, gg, bb ), yy%, ... );

PSLayerInfo.prototype.gradientColorStops = function()

It turns out that Copy CSS was not working in my CC 2015 because I uncheck export Clipboard in my Photoshop Preferences. When I check it Copy CSS works.  I can past the clipboard into Photoshop Text Tool.

Gradients seem to work OK.

JJMack