• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Preserve names when duplicating fields

Explorer ,
Feb 09, 2021 Feb 09, 2021

Copy link to clipboard

Copied

Hello everyone,

 

In PDF forms I would like to do two things:
- Duplicate interactive fields on the same page
- Duplicate pages containing interactive fields

 

In both cases, InDesign automatically changes the field names:
- A running number is added
- If the field name already ends with a number, it is increased by one

 

How can I turn off this behavior?

I need fields with the same names so that the values are automatically copied from each other.

TOPICS
Bug

Views

382

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
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 11, 2021 Feb 11, 2021

Here the basic script code for duplicating one selected item where the name will be restored:

var sel = app.selection[0];
var dup = sel.duplicate();
dup.name = sel.name;

 Code written in ExtendScript (JavaScript).

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate
Community Expert ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

Hi rgrund,

you cannot turn off that behavior.

 

Regards,
Uwe Laubender

( ACP )

Votes

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
community guidelines
Community Expert ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

That's built in by design because 2 fields with the same name will not behave as 2 separate fields. You can't change it. When you want duplicate fields to have duplicate names, you must rename the duplicates as such.

Votes

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
community guidelines
Explorer ,
Feb 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

I see. Thank you!

 

Is there a plugin or script for a simple task like "copy paste" without InDesign changing the objects on its own?

Votes

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
community guidelines
Community Expert ,
Feb 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

Here the basic script code for duplicating one selected item where the name will be restored:

var sel = app.selection[0];
var dup = sel.duplicate();
dup.name = sel.name;

 Code written in ExtendScript (JavaScript).

 

Regards,
Uwe Laubender

( ACP )

Votes

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
community guidelines
Explorer ,
Feb 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

Thanks, Uwe! For single elements the script works great. 😀

 

Is there an other simple script that copies tables which contain a bunch of form fields?

Or one that duplicates entire pages?

Votes

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
community guidelines
Community Expert ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

LATEST

For that purpose you should hire a script writer for writing a script with additional features.

You can contact me through the Private Message function of this forum. Just click my name and use the "Send a Message" button.

 

Regards,
Uwe Laubender

( ACP )

Votes

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
community guidelines