Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Quick Export as PNG as standalone script

Explorer ,
May 24, 2019 May 24, 2019

Hello,

TL;DR

I'm looking for a script that exports groups as individual PNGs (with the group name) into a folder with the document name. This is exactly what the "Quick Export as PNG" menu item is suppose to do, but cannot be properly batched.

I've been spinning my wheels on this all morning. Photoshop CC has a really useful feature under the Layers menu (or when Right-Clicking selected groups) called "Quick Export as PNG". It exports the groups as individual images into a folder adjacent to the current document - provided you have that export preference set (eg. file1 images get saved to file1-assets folder). However, it has two major flaws.

  1. When recording the function as an action, the export folder is hardcoded (even if export preferences are set to "export files to an assets folder next to the current document")
  2. It runs asynchronously, so that if you try to run this script as a batch (eg. on file1 file2 file3), it does not actually save any files until after every images has been processed. So there is no way to "grab" the image as they are processed. If the action contains a "close" step, the script fails altogether (nothing exports).

The Quora post "Is it possible to use "Quick Export as PNG" in a Photoshop action?" gives a very good rundown as well if you are looking for a different/better explanation.

And some information in this post as well: How do I quickly export a layer as a png file in Photoshop with extendscript

TOPICS
Actions and scripting
17.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , May 28, 2019 May 28, 2019

The Generate > Image Assets is actually an excellent solution for automating export, provided you can find quick/easy ways to name your layers and groups accordingly! (See below)

Heh, wow, Stephan, I can't for the life of me figure out why, but if I remove the comments at the top of your script it works fine... So, your solution effectively works!

The complete solution is as follows.

In a file with multiple groups (layersets) that you wish to export as PNG.

1. First, run this script (to append .png

...
Translate
Adobe
Community Beginner ,
Jun 11, 2019 Jun 11, 2019

I was able to find a different method for exporting the files I needed - but if anyone figures out the conditions for executing "AdobeScriptAutomation Scripts" I'm very curious as to when that can and can be used inside a script. At this point it's more a matter of curiosity.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2022 Feb 24, 2022
LATEST

A couple more options here (works on all root/top-level layers and layer sets):

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-do-i-export-layers-as-png-without...

 

All top level layers saved to PNG.jsx
All top level layers exported to PNG.jsx

 

One can record the scripts into an action, then use the Automate > Batch command.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines