Internal error creating CSS: undefined is not an object at script line 970
Copy link to clipboard
Copied
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.
Explore related tutorials & articles
Copy link to clipboard
Copied
Has anyone found an answer for this?
Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
Does it fail on all layers or just the ones that have gradients?
Copy link to clipboard
Copied
For me it fails only on gradient layer
Copy link to clipboard
Copied
Hi,
I have the same error. I am also tried to export css of gradient. I work olso from mac, Photoshop 2021

