Skip to main content
payalm68947498
Inspiring
February 8, 2019
Answered

How to get Alternate Layout Name to delete alternate layout

  • February 8, 2019
  • 1 reply
  • 735 views

Hi...

          I want to get name of layout as shown in image (Letter V) to delete alternate layout through scripting.

This topic has been closed for replies.
Correct answer Manan Joshi

A seemingly more concise way to do this is the following

app.documents[0].sections.everyItem().alternateLayout

The resultant array can also contain blank entries for sections that do not have an alternatelayout applied to it.

-Manan

1 reply

Community Expert
February 8, 2019

Something like the following should work. I have not worked with alternatelayouts so there maybe a more elegant way, suggestions are always welcome for improvement

var altLayout = app.documents[0].pages.everyItem().appliedAlternateLayout

var uniqueList = {}

while(a = altLayout.pop())

     uniqueList[a.alternateLayout] = true

for(var a in uniqueList)

     alert(a)

-Manan

-Manan
Manan JoshiCommunity ExpertCorrect answer
Community Expert
February 8, 2019

A seemingly more concise way to do this is the following

app.documents[0].sections.everyItem().alternateLayout

The resultant array can also contain blank entries for sections that do not have an alternatelayout applied to it.

-Manan

-Manan
payalm68947498
Inspiring
February 9, 2019

Thank you manan.....