// my hello world init(); function init(){ var myDoc=app.documents.add(); var myPage=myDoc.pages.item(0); var myTextFrame=myPage.textFrames.add(); var myBounds = myGetBounds(myDoc,myPage); myTextFrame.geometricBounds=myBounds; myTextFrame.contents="Hello World!"; } function myGetBounds(myDoc, myPage){ with(myDoc.documentPreferences){ var myPageHeight = pageHeight; var myPageWidth = pageWidth; } with(myPage.marginPreferences){ var myTop = top; var myLeft = left; var myRight = right; var myBottom = bottom; } myRight = myPageWidth - myRight; myBottom = myPageHeight- myBottom; return [myTop, myLeft, myBottom, myRight]; }