Please ignore the console.println(pages.toString()) inside the for loop, that was a mistake in pasting... it originally was console.println(i+1) for testing purposes.
Always use the doc.syncAnnotScan method before attempting to extract any information about annotations.
Wow, that worked perfectly, thanks! Guess I should have read the documentation before jumping in.
I would use the Join() method rather than the toString() method. If this is a document level function, then you need to pass the document object as a parameter tot he function.
function FindMarkups (oDoc)
var pages = ;
for (var i = 0; i <= oDoc.numPages; i++)
if(oDoc.getAnnots(i) != null)
pages.push(i + 1);
if(pages.length > 0)
+ " has comments!", //message
console.println("\nChecking for markup on " + this.documentFileName + "...");