Scribus Forums

Scribus => Scripts and Plugins => Topic started by: Derek on January 24, 2022, 04:19:09 PM

Title: Getting Group Members
Post by: Derek on January 24, 2022, 04:19:09 PM
Is it possible to get a list of members of a group?

Something like:


...

if getObjectType(name) == "Group":
    groupMembers = getGroupMembers(name)

# Do something with groupMembers

...


I'm hoping to avoid having to store the group's attributes, explode the group, (do something), then reassemble the group and restore the attributes.
Title: Re: Getting Group Members
Post by: RobSay on February 05, 2022, 03:29:35 PM
I've not found a way to do this - the only work around I found (and rejected) was to select the group object, ungroup the object at which point you had all the members of the group selected and could do things. Two principle disadvantages here are that all the attributes and properties of the group are deleted with ungroup - and if the intent is to manipulate one of the members you have to keep a track of the other members to regroup them after the fact

I've always written my scripts to avoid doing this - mainly my making sure I only create the group and add attributes to the group after I had really definitely finished do anything inside the group ... I also use naming conventions (prefixes) for the objects as I create them which does help with the logic.