"Invert" and reorder list of numbers (for deleting pages in pdf)

Dragging up memories of Maths from <cough> 50+ years ago...

You want the complement of the set of pages to keep. The most basic way to get the complement is to delete all the members of the set from the "universal set" -- the complement is whatever's left.

In this case, the universal set is "all the pages", i.e. {1,2,3,...,n}, where n is the number of pages in the document. And we can do what you want in KM with some simple text munging:

Get Pages to Delete.kmmacros (6.8 KB)

Image

There will be faster ways to do this for large lists, but this is very understandable!