I have an InDesign document with ~550 pages. On an every page, there are 4 frames, all the pages look the same (see image below). I'm using InDesign CS6 and JS.
I need a script that fulfills some rather basic functions, if possible:
1.
- Target text frame (1)
- Delete the text frame
2.
- Target text frame (2)
- Applying a given paragraph style
3.
- Target image frame (4)
- Fit Frame Proportionally
- Do so on all pages

I tried the following (see below). Somehow, ID tells me "myParagraph.applyParagraphStyle" and "myFrame.fit" is "not a function".
2.
var myDocument = app.activeDocument;
myParagraph = myDocument.pages.item(1);
myParagraphStyle = myDocument.paragraphStyles.item('datum');
myParagraph.applyParagraphStyle(myParagraphStyle,true);
3.
var myDocument = app.activeDocument;
var myGraphic = myDocument.pages.item(3);
var myFrame = myGraphic.parent;
myFrame.fit(FitOptions.proportionally);