Scribusoid

Author Topic: get the layer an object is on  (Read 562 times)

jvr14115

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
  • Scribus User
get the layer an object is on
« on: November 18, 2018, 05:18:57 pm »
How do I get the name of the layer that an object is on?

I need to get a csv list with all objects in a scribus file.
so far that's working.
However, I also need to get the layer the object is on. I haven't found a way to do this:
- the layer(name) is not in the object properties.
- it would be possible to loop layers, but I havent found a way to select/loop the objects on that layer (only page).
- I thought selecting anabject might be a way to get the "active layer", but selecting the object does not activate the layer.

any ideas? if possible easy ones :)

utnik

  • Hero Member
  • *****
  • Posts: 1289
  • Karma: 14
Re: get the layer an object is on
« Reply #1 on: November 19, 2018, 07:58:38 pm »
hi jvr

…I thought selecting anabject might be a way to get the "active layer", but selecting the object does not activate the layer.

it depends…
selecting an object in the 'outline' window activates the layer.

utnik

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1985
  • Karma: 26
    • the graphics lab
Re: get the layer an object is on
« Reply #2 on: November 19, 2018, 10:26:11 pm »
no, i could not find in the API a function to get that information.

there have been a few new commands that have been contributed by users in the last few weeks... and if you have brave enough, you could also get inspiration from one of those commits and propose a patch.

i can help you with finding how to get information from the scribus code...

it's probably better to create a new command, rather than extend the properties of the item... but i should first check how exactly you get the information.