Copy link to clipboard
Copied
I am using Indesign cs6. I want to make interactive Pdf using the Text Frame can convert into Text Field. I can be done manually(see above Image), but i need to make the same thing by using scripting. i don't know how to do using scripting anyone please help me.
Thanks,
[Discussion Moved to InDesign Scripting Forum by Moderator]
[Correct Answer changed by Moderator]
Hi Sangeetha,
surprisingly I found no direct method for converting a text frame or something else to a "Text Field" (in scripting terms: object textBox) by scripting. I could be wrong, but maybe the developers did not provide that when form fields were introduced.
What is working is using the menu command for this by scripting.
For that you'll need a selected object in the document to start with.
Here an ExtendScript (JavaScript) script snippet that will do this for one single item selected:
...// Text
Copy link to clipboard
Copied
You have posted this in the main InDesign Forum. I will move this to the InDesign Scripting Forum so that you can receive more technical help.
Best,
EW
Copy link to clipboard
Copied
Hi Sangeetha,
surprisingly I found no direct method for converting a text frame or something else to a "Text Field" (in scripting terms: object textBox) by scripting. I could be wrong, but maybe the developers did not provide that when form fields were introduced.
What is working is using the menu command for this by scripting.
For that you'll need a selected object in the document to start with.
Here an ExtendScript (JavaScript) script snippet that will do this for one single item selected:
// Text frame, rectangle, oval or polygon should be selected:
var sel = app.selection[0];
// Menu command "Convert To Text Field":
var convertToTextField = app.menuActions.itemByName("$ID/$$$/Command/TextField");
// If available:
if(convertToTextField.enabled)
{
convertToTextField.invoke();
};
( This will not work with InDesign Server. )
Regards,
Uwe
Copy link to clipboard
Copied
Thank you so much
Copy link to clipboard
Copied
Sorry sangeethak65390815 - But it was Laubender answer that was actually correct. I just moved this to the appropriate forum.
That's certainly helpful of me to do so but not correct or fair to Laubender who has given you a very detailed and helpful answer.
Best,
EW
Copy link to clipboard
Copied
Its ok and thanks for your response
Copy link to clipboard
Copied
Top,
Thank you so much