Jump to content
You must now use your email address to sign in [click for more info] ×

Recommended Posts

How can one group multiple layers in a Macro? I can record a Group operation, but what is the envisioned usage of that if I am unable to have more than one layer selected before it. Also doesn't seem possible to record moving a layer into a group.

Link to comment
Share on other sites

Two options

1. Edit > Cut the layer you want to add to the group, select the Group then Edit > Past Inside to add the layer to the Group.

2. Select all layers, Set visibility for all layers to off, deselect all layers, select the 1st layer you want in the group and set visibility for that layer back on, repeat for all other layers you want in the group, then select all layers (only visible layers will be selected), Group them. To switch visibility for all other layers back on again first deselect all layers then Layer > Show All

I will let you find out the limitations of the above 2 options in certain circumstances as I am getting more and more frustrated with what should be simple macro commands and what actually happens when the macro records them.

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Link to comment
Share on other sites

4 hours ago, carl123 said:

I will let you find out the limitations of the above 2 options in certain circumstances as I am getting more and more frustrated with what should be simple macro commands and what actually happens when the macro records them.

One of the biggest limitations for me is that I have found no acceptable way to specify a particular layer that works for documents with an arbitrary number of layers.

 

If the layer structure is simple enough, I can start the macro by giving each layer a unique name, using the 'Select layer1 from the top' option for the first & then the 'Select layer 1 below current' for each of the others in turn, so that afterwards I can select any layer by name. Of course, the problem with that is it overwrites any layer names I might previously have created for the file. There is also an option to select a child layer by its number, but without knowing how many child layers a file might have, I don't know how to make sure each of them is selected in turn, or what would happen if the macro has a 'select child 4' step but the parent has fewer than 4 children.

 

If there are any workarounds for this I would love to know what they are, but I suspect the only real solution is a scripting language that supports variables, conditionals, error handling, & so on.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • 1 year later...

I tried both options and it appears you can't do any of that whilst recording a macro. What I mean is, I want to group four or five adjustment layers together so I can add a single mask to them and I cant seem to find a way of recording this operation in a macro.

Link to comment
Share on other sites

One nice difference between version 1.6.7 (the retail version) and version 1.7 (the beta) is the addition of "Move Inside" and "Move Outside" on the Arrange menu. When I choose a layer immediately above an existing group, choosing the "Move Inside" command will put that layer into the group. The other thing you have to know about navigating in and out of groups is that, once you have chosen a layer inside a group, the only way to get out of the group is to choose the group itself (the "parent layer") and then add layers, move around, etc.

I have attached 2 files. The first is an .afphoto file with a picture of a Red Flower and 4 adjustment layers on top of it. Open this file WITH THE BETA VERSION, not the retail version. The second file is a zipped .afmacro file. Import this from the hamburger menu in the MACROS panel (not from the Library panel). When you run the macro, it initially chooses the bottom layer (the photo itself) and then sequentially moves up the stack to the 4 adjustments. At the first adjustment, it creates a Group. At the 2nd, 3rd, and 4th adjustment layers, it uses the "Move Inside" command. Then, the Group itself is selected and the "Add Mask" command is given.

This should demonstrate that what you are trying to do is certainly possible, even without scripting, variables, loops, etc.

Red Flower with 4 Adjustments.afphoto

Group Adjustments & Insert Mask.afmacro.zip

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.