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

renaming items when duplicating

Explorer ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

Hello - 

I have objects or groups on a page that are labeled with numbers (e.g. "Q1" "A1" "Q2" "A2"  etc...).  

If I duplicate the spread or page - those objects are relabeled up one value - so Q1 becomes Q2 on the new page...    

 

If I have multiple items, the duplicates are labeled from the last number.  So if I have Q1- Q7 on one page, in the new page, the items are listed as Q8 - Q14.   

 

Is there a way to stop this from happening and just duplicate them exactly?

 

Thanks!

 

TOPICS
How to

Views

249

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 , Sep 09, 2023 Sep 09, 2023

Ah, buttons. Why didn't you say so straight away?

 

The name you see in the Layers panel is the name used in the Buttons and Forms panel. It's dangerous to have non-unique names for buttons because various button actions use names as referents. Identical names cause ambiguity, which you don't want. You can't prevent InDesign from changing the button's name when you duplicate it.

 

If that ambiguity is not a problem for you, the only way is to rename the duplicated items manually. Which is a hass

...

Votes

Translate

Translate
Community Expert ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

What do you mean by 'labels'? Can you show a screenshot?

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 ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

How they are named in the layers panel

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 ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

Labels in the Layers panel are static, just plain text How do you get the labels to change when you duplicate an item? Do you use a plug-in that manages page items through layer names?

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 ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

they are buttons.  and when i duplicate buttons, they automatically get renamed.    in the attached screenshot - that should all be 1-7...     is there a way to duplicate an entire spread / page that contains buttons without renaming the buttons?

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 ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

Ah, buttons. Why didn't you say so straight away?

 

The name you see in the Layers panel is the name used in the Buttons and Forms panel. It's dangerous to have non-unique names for buttons because various button actions use names as referents. Identical names cause ambiguity, which you don't want. You can't prevent InDesign from changing the button's name when you duplicate it.

 

If that ambiguity is not a problem for you, the only way is to rename the duplicated items manually. Which is a hassle. A script is possible that adds the names of selected items as script labels before you duplicate the item(s), then after duplicating them renames them on the basis of the script labels.

 

Anyway, to answer your question, no, you can't prevent the renaming of buttons.

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 ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

yeah - i understand the logic behind non-duplicate button names when on the same page, but wondering why it renames when duplicating an entire page.  i am not advanced enough for scripts.  is there a tutorial on how to create and utilize them?  I would greatly speed up my workflow to be able to duplicate a page and have all the buttons keep their original names.

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 ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

wondering why it renames when duplicating an entire page

 

Because a button can reference another button on another page. Those relations aren't confined to a page.

 

i am not advanced enough for scripts.  is there a tutorial on how to create and utilize them?

 

Google around, there are some posts on this forum that give overviews of available material. Count on a steep learning curve.

 

What you're after is in fact easy to script (see below), maybe it works for you.

1, Before using it, save your document and make a copy or zip it up.

2. Then select one or more boxes and run the script. The script adds script labels, you can see those in the Script Label panel (Window > Utilities > Script Label). Select a button and the label is shown.

3. Duplicate the selection.

4. Run the script again. It now renames the buttons on the Layers and the Buttons panels.

 

Note: the script works only on selections. So if you duplicate a page or a spread, first select the buttons on the spread and run the script. Then duplicate the page or spread. Finally, select the buttons on the duplicated page/spread and run the script again.

 

(function () {
  var s = app.selection;
  for (var i = 0; i < s.length; i++) {
    if (s[i] instanceof Button && s[i].label === '') {
      s[i].label = s[i].name;
    } else {
      s[i].name = s[i].label;
    }
  }
}());

 

 

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 ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

i'll give it a shot.  thank you!

 

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 ,
Sep 11, 2023 Sep 11, 2023

Copy link to clipboard

Copied

LATEST

Hi @imgaryshap74 ,

you can show and also edit the label of an individual item selected with InDesign's Script Label panel:

Windows > Utilities > Script label

 

Note:

If you have more items selected with different labels the Script Label panel will show no contents.

If you have more items selected with the same labels the Script Label panel will show the contents.

 

If you want empty labels for all selected items, your buttons for example, do the following:

[1] If the Script Label panel shows some contents edit and remove the contents in the panel.

[2] If the Script Label panel shows no contents because every label is different, do the following 2-step process:

Type some contents so that all labels share the same contents and unselect the selection of elements to store the labels.

Select your items again and then as step 2 remove the contents of the Script Label panel.

Unselect the selection and all selected items share empty labels.

 

Regards,
Uwe Laubender
( Adobe Community Expert )

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