Answered
How to identify the first and last pages?
My code.:
var sel = app.documents[0].selection;
pp = sel[j].parentPage;Now there are three conditions that can identify left and right pages, as well as single pages
pp.side == PageSideOptions.RIGHT_HAND
pp.side == PageSideOptions.SINGLE_SIDED
pp.side == PageSideOptions.LEFT_HANDI now want to handle the first and last pages separately. It would be helpful if I could determine whether the current page is a spread.

