Remove Text Frame -- InDesign CS5

Dear All,

Below code is working fine with InDesign CS3 and CS4, but not working with CS5. I have a text frame with label “myRemoveFrame” and I want to delete.

tell application "Adobe InDesign CS5"
    set myDoc to front document
    tell myDoc
        set myPageItems to page item "myRemoveFrame"
        repeat with aFrame in myPageItems
            if class of aFrame is text frame then delete aFrame
        end repeat
    end tell
end tell




Try this:

tell application "Adobe InDesign CS5"
	delete (every text frame of document 1 whose label is "myRemoveFrame")
end tell

One thing i would say is when your creating your script labels just be careful that you
don’t return onto the next line as it causes an error.

when you return the label property you can end up with:

when you want: