Hi Deepak thanks for reply
I tried page.textFrames.itemByName("Main1").select(); but it is giving an exception as:
Public member 'itemByName' on type 'Textframes' not found
so please help me out.
I guess that in VBscript it would be ItemByName (capital I).
vbscript is not case sensitive. it will take ItemByName and itemByName both the values.
itemByName is a property of Textframe not of Textframes.
I don't have CS6 but try this
if it works, then you probably have a spelling error. Remember it is case sensitive, 'Main1' is not the same as 'main1'.
it should work either way, but again I don't have CS6 to try.
i don't want to try page.TextFrames.item(1).select because it will select only first textframe in to the multiple textframes present on the page. I want to select only that textframe which is labeled as Main1. If I am writing a loop which will go through each and every frame check the label and if label match to Main1 then select that frame but I don't wan't that.
I tried page.TextFrames("Main1").select also but this is also not working.
hmm...how do I say it?...can you please try it? you already know it will select the first frame, that's what we're trying to find out, if it works....it works.
can you post a screen shot of the layers palette (expanded) showing (clearly) the textFrame "Main1"
we're getting close, can you "expand" the layer, and scroll until we see the actual textFrame listed?
do you see a little blue square next to textFrame1 in my screen shot?
@Crest-Raj – so, as you can see, there is no text frame by the name of "Main1". You either have to rename the text frame in the Layers Panel or do it by script.
app.selection.name = "Main1";
Close/re-open the Layers Panel and you'll see the updated name.
All the "names" in brackets are generic names InDesign will create, if you are creating a text frame.
For new empty text frames the generic name is: "<text frame>".
In the moment you insert contents, the generic name will change according to the contents.
If you try to get the "name" property of a text frame with a generic name, you'll get an empty String!
After re-naming the Text Frame in the Layers Panel or by scripting, the name will not change, if you add or delete contents.
Again Thanks to all.