Skip to main content
jeva72
Known Participant
September 1, 2025
Answered

convert artboard to a group of layers

  • September 1, 2025
  • 3 replies
  • 282 views

Is there an easy and simple way?

Correct answer Stephen Marsh

For extendscript:

 

var idungroupLayersEvent = stringIDToTypeID( "ungroupLayersEvent" );
    var desc241 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref1 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref1.putEnumerated( idLyr, idOrdn, idTrgt );
    desc241.putReference( idnull, ref1 );
executeAction( idungroupLayersEvent, desc241, DialogModes.NO );

 

Or:

 

ungroupLayersEvent();

function ungroupLayersEvent() {
	var c2t = function (s) {
		return app.charIDToTypeID(s);
	};
	var s2t = function (s) {
		return app.stringIDToTypeID(s);
	};
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
	descriptor.putReference( c2t( "null" ), reference );
	executeAction( s2t( "ungroupLayersEvent" ), descriptor, DialogModes.NO );
}

 

Or:

 

app.runMenuItem(stringIDToTypeID("ungroupLayersEvent"));

3 replies

Participating Frequently
September 4, 2025

I DONT KNOW

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
September 1, 2025

For extendscript:

 

var idungroupLayersEvent = stringIDToTypeID( "ungroupLayersEvent" );
    var desc241 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref1 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref1.putEnumerated( idLyr, idOrdn, idTrgt );
    desc241.putReference( idnull, ref1 );
executeAction( idungroupLayersEvent, desc241, DialogModes.NO );

 

Or:

 

ungroupLayersEvent();

function ungroupLayersEvent() {
	var c2t = function (s) {
		return app.charIDToTypeID(s);
	};
	var s2t = function (s) {
		return app.stringIDToTypeID(s);
	};
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
	descriptor.putReference( c2t( "null" ), reference );
	executeAction( s2t( "ungroupLayersEvent" ), descriptor, DialogModes.NO );
}

 

Or:

 

app.runMenuItem(stringIDToTypeID("ungroupLayersEvent"));
jeva72
jeva72Author
Known Participant
September 8, 2025

Thanks, could you please elaborate a little on what these scripts do and how to use them?

jeva
Stephen Marsh
Community Expert
Community Expert
September 8, 2025
quote

Thanks, could you please elaborate a little on what these scripts do and how to use them?


By @jeva72


They all do the same thing, as per your original request, ungrouping (converting) the active/selected Artboard to layers via legacy ExtendScript/JavaScript. As you tagged your post with "actions and scripting" I assumed that was what you were looking for. If you want an action, record it as per the suggestion from @Trevor.Dennis - which is the same as the code that I posted. Or were you looking for UXP scripting?

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html?m=1

Trevor.Dennis
Community Expert
Community Expert
September 1, 2025

Layer > Ungroup Artboards

Or you can create files with:

File > Export > Artboards to files

https://www.youtube.com/watch?v=xmrJhk0x5zg&t=273s

jeva72
jeva72Author
Known Participant
September 8, 2025

Thanks, but that is not what I asked.  I did my reasearch otherwise I would not ask it here.  I have PSB files with artboards, 20-30 in each file, can I convert the artboards in one file to groups or not? I know there are some workarounds, but all take a lot of time.  

jeva
Stephen Marsh
Community Expert
Community Expert
September 8, 2025
quote

I have PSB files with artboards, 20-30 in each file, can I convert the artboards in one file to groups or not?


This contains different info to your original post:

 

"convert artboard to a group of layers: Is there an easy and simple way?"

 

Why do you need to do this? What's the end goal or result?

 

So, are you looking for a script that will convert every artboard in the active document to a group?

 

What else?

 

How would the artboard content be positioned?

 

Do you then want to batch process many files?

 

EDIT: Sample files or screenshots are always helpful over guesswork.