Highlighted

InDesign layers to Photoshop JS Version

Adobe Community Professional ,
Oct 05, 2020

Copy link to clipboard

Copied

If anyone is interested in a Javascipt version of my InDesign to Photoshop Layers AppleScript, I’ve converted it to JS via BridgeTalk and the first version is here:

 

https://shared-assets.adobe.com/link/5aa6cfc2-d1bf-47e1-6b6b-70aec58f38b5

 

Click the Download link, save to your InDesign Scripts folder, where you can run it from the Scripts panel. I also included a layered test ID file.

 

I have tested on OSX High Sierra with CC2020, and it seems to work fine, but would welcome feedback if there are any problems.

 

Here is the current AppleScript version and the original forum thread from 2015:

 

https://shared-assets.adobe.com/link/728a217f-b0b1-49ae-4bf8-1dd6c98465b7

 

https://community.adobe.com/t5/indesign/how-to-export-indesign-layers-to-photoshop-layers-same-struc...

 

https://shared-assets.adobe.com/link/5aa6cfc2-d1bf-47e1-6b6b-70aec58f38b5

https://shared-assets.adobe.com/link/5aa6cfc2-d1bf-47e1-6b6b-70aec58f38b5

TOPICS
Import and export, Scripting

Views

103

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

InDesign layers to Photoshop JS Version

Adobe Community Professional ,
Oct 05, 2020

Copy link to clipboard

Copied

If anyone is interested in a Javascipt version of my InDesign to Photoshop Layers AppleScript, I’ve converted it to JS via BridgeTalk and the first version is here:

 

https://shared-assets.adobe.com/link/5aa6cfc2-d1bf-47e1-6b6b-70aec58f38b5

 

Click the Download link, save to your InDesign Scripts folder, where you can run it from the Scripts panel. I also included a layered test ID file.

 

I have tested on OSX High Sierra with CC2020, and it seems to work fine, but would welcome feedback if there are any problems.

 

Here is the current AppleScript version and the original forum thread from 2015:

 

https://shared-assets.adobe.com/link/728a217f-b0b1-49ae-4bf8-1dd6c98465b7

 

https://community.adobe.com/t5/indesign/how-to-export-indesign-layers-to-photoshop-layers-same-struc...

 

https://shared-assets.adobe.com/link/5aa6cfc2-d1bf-47e1-6b6b-70aec58f38b5

https://shared-assets.adobe.com/link/5aa6cfc2-d1bf-47e1-6b6b-70aec58f38b5

TOPICS
Import and export, Scripting

Views

104

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 05, 2020 1
Adobe Community Professional ,
Oct 05, 2020

Copy link to clipboard

Copied

Thanks, Rob!

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

Copy link to clipboard

Copied

Thank you very much, Rob!

 

Regards,
Uwe Laubender

( ACP )

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

Copy link to clipboard

Copied

Hi Uwe, The JS vesion is storing the exported layers in the OS’s temp folder. I can see that it is working on OSX, but don’t have a Windows machine to test on. If you get a chance could you try it on Windows. 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 06, 2020 0
Adobe Community Professional ,
Oct 06, 2020

Copy link to clipboard

Copied

Hi Rob,

will test and debug your code the next days. A first try, just running your script on your provided INDD document, failed.

This is the core error message where I translated the German parts:

 

/*
JavaScript Error!
Error number: 2
Error message: rgbProf is undefined
Line: 189
*/

 

 

An "Adobe Illustrator" file, I know it's a PDF with ai suffix, was showing up in a temp folder in my user folder under:

 

Error-2-rgbProf-is-undefined-TempFileCreated.PNG

Did not look much into the code, so I have no clue what exactly went wrong.Your test document was left in the following state after I answered the error message:

 

Error-2-rgbProf-is-undefined-StateOfTheDocAfterError.PNG

 

First hint:

 

var rgbProf = doc.rgbProfile; // returns "sRGB IEC61966-2.1"

 

 

So that should work. But obviously bt.body in line 189 does not work as expected. Hm. Maybe it's the target declaration two lines before? I cannot see that PhotoShop is starting up. Maybe the string "photoshop" is not enough. Have to run BridgeTalk Diagnostics to get a reliable string first.

 

Will be back tomorrow.

 

Regards,
Uwe Laubender

( ACP )

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

Copy link to clipboard

Copied

Hi Uwe, thanks for testing. I did discover a bug this morning that might be related. I was trying to store the dialog results in an object, which threw an error when I cancelled.

 

I posted an update in the same folder. The new code moves the rgbProf variable into the function with Bridgetalk, so it might help with the error you were getting.

 

https://shared-assets.adobe.com/link/5aa6cfc2-d1bf-47e1-6b6b-70aec58f38b5

 

Also, the .ai extension is intentional. When the PS layers are smart objects, double clicking to edit will open the layer in Illustrator.

 

 

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

Copy link to clipboard

Copied

Latest is ExportLayersToPSv3.jsx

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 08, 2020 1