Hi my dear gurus,
I have a good question for you. I am trying to script iWork Pages 2, but, as you know, the documentation provided by Apple is zero.
The routine I am building is to search for a particular type of paragraph and prints its page number. Simple? not so fast.
tell application "Pages" set NameText to "xxx.pages" repeat with z from 1 to the count of paragraphs of body text of document NameText if (paragraph style of paragraph z of body text of document NameText is "Title") then set PageNumber to page number of (paragraph z of body text of document NameText) display dialog PageNumber end if end repeat end tell
Then I get the following error message:
This error highlights the following line:
set PageNumber to page number of (paragraph z of body text of document NameText)
How can I read the page number property of a document? Nothing seems to work! Please help, I am desperate.