Highlighted

Copy to css with script

Explorer ,
Oct 01, 2020

Copy link to clipboard

Copied

So i'm trying to find the script that does the "Copy to css" because i would like to automate it within photoshop using a custom script. I've found this link on the forum but it doesn't provide a solution.
https://community.adobe.com/t5/photoshop/how-to-get-the-result-of-quot-layer-copy-css-quot-using-scr... 

I'am using photoshop 2020 on mac. Any ideas on where i can find it?

 

Many thanks

TOPICS
Actions and scripting, How to, Mac, Make It

Views

78

Likes

Translate

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

Copy to css with script

Explorer ,
Oct 01, 2020

Copy link to clipboard

Copied

So i'm trying to find the script that does the "Copy to css" because i would like to automate it within photoshop using a custom script. I've found this link on the forum but it doesn't provide a solution.
https://community.adobe.com/t5/photoshop/how-to-get-the-result-of-quot-layer-copy-css-quot-using-scr... 

I'am using photoshop 2020 on mac. Any ideas on where i can find it?

 

Many thanks

TOPICS
Actions and scripting, How to, Mac, Make It

Views

79

Likes

Translate

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
Oct 01, 2020 0
Adobe Community Professional ,
Oct 01, 2020

Copy link to clipboard

Copied

What exactly do you want?
The ScriptListener gives this code when the Copy CSS command is executed.
This is it?
var d = new ActionDescriptor();
var r = new ActionReference();
r.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
executeAction(stringIDToTypeID("copyLayerCSS"), d, DialogModes.NO);
 
Copying is done to the clipboard.

Likes

Translate

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
Reply
Loading...
Oct 01, 2020 1
NH5EAB LATEST
Explorer ,
Oct 02, 2020

Copy link to clipboard

Copied

Thanks for your reply. I've build upon a custom photoshop panel following this tutorial: https://medium.com/adobetech/how-to-create-your-first-adobe-panel-in-6-easy-steps-f8bd4ed5778 

 

I'm trying to build an index.html from a .psd file. So now when a button is clicked in the panel it exports all layers to images and outputs a JSON that is used to build the .CSS file from. But maybe it could be done easier. So what i want to do is with the push of a button export all layers css to a single .css file. I'm not sure but i see your example is VBS script? Is it possible to see a javascript example? Thanks

Likes

Translate

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
Reply
Loading...
Oct 02, 2020 0