Highlighted

Indesign Buttons and Forms

Community Beginner ,
Sep 11, 2020

Copy link to clipboard

Copied

How to write default value(default text) in text field in indesign(not in pdf)? and how to get it?

TOPICS
SDK

Views

111

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Indesign Buttons and Forms

Community Beginner ,
Sep 11, 2020

Copy link to clipboard

Copied

How to write default value(default text) in text field in indesign(not in pdf)? and how to get it?

TOPICS
SDK

Views

112

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 11, 2020 0
Adobe Community Professional ,
Sep 11, 2020

Copy link to clipboard

Copied

I have no clue what you are saying. 

 

Please elaborate and show screenshots if you want us to help you.

 

jonathan

[moderator]

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2020 0
Community Beginner ,
Sep 13, 2020

Copy link to clipboard

Copied

Hello Sir,

           I Want to Know how to write some default text in textfield (while writing  in Form field)in indesign.I tried for this in this way(following screenshot shows this). But while reading in indesign (from indesign sdk functions). I did'nt get it.Screenshot 2020-09-14 at 10.25.18 AM.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 13, 2020 0
Adobe Community Professional ,
Sep 14, 2020

Copy link to clipboard

Copied

I don't think you can with scripting, certainly cannot do this without scripting.

 

I've had a look at the textbox object model and there doesn't seem to be a property for default text. https://www.indesignjs.de/extendscriptAPI/indesign-latest/#TextBox.html#d1e160232

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 14, 2020 0
Adobe Community Professional ,
Sep 15, 2020

Copy link to clipboard

Copied

Hi Madhri1,

you tagged your question with the "SDK" label.

Sorry, but I can only tell how this is working in the scripting DOM with ExtendScript.

 

The object textBox has no texts or parentStory property.

So you cannot get directly to your typed text.

 

Instead, textBox has properties like pageItem or even textFrame.

So get your text this way:

myTextBox.textFrames[0].texts[0]

 Or this way:

myTextBox.pageItems[0].getElements()[0].texts[0]

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 15, 2020 0
Community Beginner ,
Sep 16, 2020

Copy link to clipboard

Copied

Sir,its not a normal textbox....my Question was about textfield(FormField related question)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 16, 2020 0
Adobe Community Professional ,
Sep 16, 2020

Copy link to clipboard

Copied

Hi Madhuri1,

the variable "myTextBox" in my code snippet stands for an InDesign textBox object which is indeed a form field.

You must not confuse the textBox object with a textFrame object.

 

What my code is showing:

The textBox object contains a textFrame object.

And that text frame contains your formatted text which is texts[0].

( All that said in ExtendScript scripting terms. )

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 16, 2020 1
Community Beginner ,
Sep 16, 2020

Copy link to clipboard

Copied

okay sir,thank you

also I want this text using present functions in indesign sdk,means

for example I got formfield name using following code :

( pageItemUIDRef - UIDRef of that shape)

 InterfacePtr<IGraphicStyleDescriptor>descriptor (pageItemUIDRef,UseDefaultIID());

PMString field_name = Utils<IAttributesUtils>()->GetStringValue(descriptor,  kFormNameAttrBoss);

likewise I want that deafult text...

 

I was tried this way PMString field_val = Utils<IAttributesUtils>()->GetStringValue(descriptor, kFormValueAttrBoss);

but it does'nt work.

I used IGraphicStyleDescriptor, IAttributesUtils.h and FormFieldId.h files from indesign sdk.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 16, 2020 0
Adobe Community Professional ,
Sep 15, 2020

Copy link to clipboard

Copied

FWIW: If that typed in text is working as default with an exported interactive PDF is a different question.

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 15, 2020 0
Adobe Community Professional ,
Sep 15, 2020

Copy link to clipboard

Copied

The title of your question also mentions buttons

 

With buttons it's still a bit different. The state of a button could simply contain nearly "everything". A text frame, a graphic frame, a group of things etc.pp. So in case of a button you have to go through its state objects followed by a group object that contains everything in that state.

 

 

myButton.states[0].groups[0].allPageItems;
// Loop that array to find a text frame or a text paths
// to get the text that is contained by the first state.

 

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 15, 2020 0
Adobe Community Professional ,
Sep 16, 2020

Copy link to clipboard

Copied

Hi Madhuri1,

sorry. As I already said, I cannot give advice on SDK programming.

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 16, 2020 0
Community Beginner ,
Sep 16, 2020

Copy link to clipboard

Copied

okay Sir,

thank you

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 16, 2020 0