The stacking order is determined by the order by which they are inserted into the slide. However, some of the page elements in slides remain hidden.
Is there a way to change the Order of objects in Google slides using apps script?
The stacking order is determined by the order by which they are inserted into the slide. However, some of the page elements in slides remain hidden.
Is there a way to change the Order of objects in Google slides using apps script?
How about this workaround? I have experienced the same situation with you. At that time, I have moved the element using this workaround. I think that there are several workarounds for this situation. So please think of this as one of them. The flow of this workaround is as follows.
Principle:
In Google Slides, for example, when new shape is created to a slide, it is added to the last element to
pageElements
. This means that the last element topageElements
is the most front. This is used for the workaround.Flow:
insertPageElement()
. These are added to the page as new elements.pageElements
.By this, the selected shapes can be brought to the most front and back. When this flow is reflected to the script, it becomes as follows.
Sample script:
Result:
Note:
front()
orback()
. Whenfront()
is run, the selected shape is moved to the most front. Whenback()
is run, it is moved to the most back.References:
If this answer was not what you want, I'm sorry.
Updated at November 20, 2018:
The Slides service was updated at Google's update at November 14, 2018, and several methods were added for achieving this issue.