Trouble shooting an InDesign script from a tutorial

Below is a script from the Adobe InDesign CS Scripting Guide starting on page 22. When I run the script and it hits the line that says,

set myBounds to myGetBounds(myDocument, myPage)

an error comes up saying the myGetBounds is not understood. I have checked and checked the code and cannot tell for the life of me what is hanging the thing up or missing. I did have to make a correction to a miss spelling in the script that is in the guide “et” to “set”. I think something is missing but I’m not a master AppleScripter to know what that might be. I ran a JavaScript version and it worked like a charm.

Maybe someone has some time to take a look at this and let me know what is happening.

–Improved “Hello World!”
tell application “InDesign CS”
–Get a reference to a font.
try
–Enter the name of a font on your system, if necessary.
set myFont to font “Helvetica”
end try
–Get the active document and assign the result tot eh variable “myDocument”.
set myDocument to active document
tell myDocument
set myPage to page 1
–Use the handler “myGetBounds” to get the bounds of the “live area” inside the margins of page 1.
set myBounds to myGetBounds(myDocument, myPage)
tell text frame 1 of page 1
–Resize the text freame to match the page margins.
set geometric bounds to myBounds
tell paragraph 1
–Change the font, size, and paragraph alignment.
try
set applied font to myFont
end try
set point size to 72
set justification to center align
end tell
end tell
end tell
end tell
–myGetbounds is a handler that returns the bounds of the “live area” of a page.
on myGetBounds(myDocument, myPage)
tell application “InDesign CS”
set myPageHeight to page height of document preferences of myDocument
set myPageWidth to page width of document preferences of myDocument
set myLeft to left of margin preferences of myPage
set myTop to top of margin preferences of myPage
set myRight to right of margin preferences of myPage
set myBottom to bottom of margin preferences of myPage
end tell
set myRight to myLeft + (myPageWidth - (myRight + myLeft))
set myBottom to myTop + (myPageHeight - (myBottom + myTop))
return {myTop, myLeft, myBottom, myRight}
end myGetBounds

You have mistyped the line. Here is the right one:

Kari
[/quote]

Thanks. There are some typeos in the scripting documentation. By the way how do you get the lines of code to come out colour coded like your sample line?

I use Convert Script to Markup Code http://homepage.mac.com/jonn8/as/html/Convert_Script_to_MC.html
Kari

Thanks for the tip.