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

Photoshop | Creating an Action with a closed Group

Community Beginner ,
Mar 25, 2020 Mar 25, 2020

Copy link to clipboard

Copied

When I create a lengthly action, I put all the steps in a New Group (or folder). I close the group, label it. I then stop my action. When I replay the action all the steps work... but the folder with all the lengthly steps is open. It doesn't close. 

 

How do I make the folder close? I want the action to play and close the folder like the image below. Screen Shot 2020-03-25 at 8.07.41 PM.png

 

Instead when the action is played it doesn't close that folder. And looks like this. 

 

Screen Shot 2020-03-25 at 8.09.26 PM.png

 

I have tried recording the action and having me close the folder before I stopped the recording. That doesn't work. 

 

It's not a big deal when you run 1 action with one open folder. But when you begin to run several actions with several folders for a lengthly action, it gets big and messy quick. 

 

Thanks for your help. 

TOPICS
Actions and scripting

Views

1.5K

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
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 25, 2020 Mar 25, 2020

you would need to record the action a little differently.   Do not create a new layer group and add layers into the group.  Instead  just create all the layers and name them that you want in the group. When the last layer you want in the grout is added that will be Photoshop targeted layer. Add the rest of the layer you added to the targeted layers.  It Is best to record this relatively using the shortcut Shift+Alt+[  for each layer added. The Shortcut add the Previous layer to the targeted laye

...

Votes

Translate

Translate
Adobe
Community Expert ,
Mar 25, 2020 Mar 25, 2020

Copy link to clipboard

Copied

Adobe currently has 23 programs included in a full Cloud subscription
Please post the name of the Adobe program you use so a Moderator may move this message to that forum

Votes

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
community guidelines
Community Beginner ,
Mar 25, 2020 Mar 25, 2020

Copy link to clipboard

Copied

Photoshop

 

[To find a forum for your program please start at Adobe Support Community]
[Moving from generic Start/Help forum to the specific Program forum... Mod]

Votes

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
community guidelines
Community Expert ,
Mar 25, 2020 Mar 25, 2020

Copy link to clipboard

Copied

you would need to record the action a little differently.   Do not create a new layer group and add layers into the group.  Instead  just create all the layers and name them that you want in the group. When the last layer you want in the grout is added that will be Photoshop targeted layer. Add the rest of the layer you added to the targeted layers.  It Is best to record this relatively using the shortcut Shift+Alt+[  for each layer added. The Shortcut add the Previous layer to the targeted layers.  Once all the layer are targeted record menu Layer>New>Group from Layers... . In the Pop-up dialog name the group. The group will be created and closed.

JJMack

Votes

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
community guidelines
Community Beginner ,
Mar 26, 2020 Mar 26, 2020

Copy link to clipboard

Copied

Brilliant!!! It worked! Thank you so much JJMACK!!!

Votes

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
community guidelines
Explorer ,
Jul 28, 2021 Jul 28, 2021

Copy link to clipboard

Copied

This is the way to do it. But Adobe should have an assignable step in the layers panel menu "close group" in addition to what exits and the moment, which is "close all groups"  

 

Simple fact is. many things keep getting missed when Photoshop gets developed, and therefore become seemingly not possible to record these steps in Actions.

 

One other example is the "align to" .. choose "canvas" in Align the toolbar. Does not record. This kind of this is essential in Actions. 

Votes

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
community guidelines
Community Expert ,
Jul 28, 2021 Jul 28, 2021

Copy link to clipboard

Copied

 

Agreed, many seemingly obvious things are missing from actions or even scripting.

 

On the align to canvas, you can select all and align to selection, which achieves the same result and yes it is a workaround.

 

The action based "hack" that I just tested to collapse only the current selected layer set/group is absurd, but I may just look into it for "fun" as it does work...

 

atn.png

 

Convert SO to Layers (Introduced in Photoshop 21.0, November 2019 release):

https://helpx.adobe.com/photoshop/using/create-smart-objects.html

 

However, I would of course just use the script below unless this had to be purely action based.

 

Votes

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
community guidelines
Community Expert ,
Jul 28, 2021 Jul 28, 2021

Copy link to clipboard

Copied

LATEST

 

A script to collapse the current selected layer set/group here:

/*
Expand / collapse a group via JavaScript?
https://community.adobe.com/t5/photoshop-ecosystem/expand-collapse-a-group-via-javascript/m-p/7286298
By Vova_p, 16th February 2016

Modified by Stephen Marsh, 29th July 2021
https://gist.github.com/MarshySwamp/a39e3e1efee41174b3b92ee68c40fcd8
*/

#target photoshop

if (app.documents.length > 0) {

    if (app.activeDocument.activeLayer.typename === "LayerSet" && app.activeDocument.activeLayer.layers.length > 0) {
        collapseSelectedGroup();
    } else {
        //alert("This layer type is NOT a layer set/group")
    }

    function collapseSelectedGroup() {
        // Collapse selected layer group/set
        // remember name of group
        var groupname = app.activeDocument.activeLayer.name;
        // This part from  Script Listener - ungroup group
        var idungroupLayersEvent = stringIDToTypeID("ungroupLayersEvent");
        var desc14 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref13 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        var idOrdn = charIDToTypeID("Ordn");
        var idTrgt = charIDToTypeID("Trgt");
        ref13.putEnumerated(idLyr, idOrdn, idTrgt);
        desc14.putReference(idnull, ref13);
        executeAction(idungroupLayersEvent, desc14, DialogModes.NO);
        // This part from  Script Listener - group selected layers
        var idMk = charIDToTypeID("Mk  ");
        var desc15 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref14 = new ActionReference();
        var idlayerSection = stringIDToTypeID("layerSection");
        ref14.putClass(idlayerSection);
        desc15.putReference(idnull, ref14);
        var idFrom = charIDToTypeID("From");
        var ref15 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        var idOrdn = charIDToTypeID("Ordn");
        var idTrgt = charIDToTypeID("Trgt");
        ref15.putEnumerated(idLyr, idOrdn, idTrgt);
        desc15.putReference(idFrom, ref15);
        executeAction(idMk, desc15, DialogModes.NO);
        // Recall group name
        app.activeDocument.activeLayer.name = groupname;
    }
} else {
    alert('A document must be open to use this script!');
}

Votes

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
community guidelines
Community Expert ,
Mar 26, 2020 Mar 26, 2020

Copy link to clipboard

Copied

The panel menu Layer > Collapse All Groups can also be recorded or inserted into an action, however it is all or nothing.

Votes

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
community guidelines