Skip to main content
SuzzyFlamingo
Inspiring
February 26, 2025
Question

Repeting task with hotkey

  • February 26, 2025
  • 2 replies
  • 472 views

Hi friends!

I want to assign to a hot key:

1. insert achored obejct (text box) again and again always witht the certian settings that I will choose the first time and assign that exact action to a hot key.

Sorry if so simple

-- SF

2 replies

Peter Kahrel
Community Expert
Community Expert
February 26, 2025

Barb nailed it: a script can place a frame and apply an object style. Here's the script. Where it says 'xyz' enter the name of your object style.

(function () {
  try {
    var tf = app.selection[0].textFrames.add ({
      appliedObjectStyle: app.activeDocument.objectStyles.item ('xyz')
    });
    tf.insertionPoints[0].select();
  } catch (_) {
    alert ('Select an insertion point');
  }
}());

The anchored frame is inserted and the cursor is placed in the frame so you can type away straight away.

 

Apply the script to a shortcut key in the keyboard editor.

SuzzyFlamingo
Inspiring
February 27, 2025

Thank you for your attention!

I tried it and I am getting this error: (the cursor is positioned within a text frame)

Plz inform

Thank you, and have a good day!
Susan Flamingo

Peter Kahrel
Community Expert
Community Expert
February 27, 2025

As the message says: select an insertion point. In other words, click in the text where the anchor should be placed.

Barb Binder
Community Expert
Community Expert
February 26, 2025

Hi @SuzzyFlamingo:

 

InDesign doesn't have macros/actions that you can record and assign to a hot key as you are describing. Someone with scripting knowledge can help with a script that will do this and I'll add the scripting tag to get their attention. 

 

In the meantime, without outside help (and a potential fee for development—it depends on who responds and the complexity of the job), you can create an object style for your text frame with your prefered settings. This will allow you to draw a text frame, drag to anchor it and then assign the object style (that can be assigned a keyboard shortuct!) with your frame presets.

 

See https://helpx.adobe.com/indesign/using/object-styles.html

 

~Barb

~Barb at Rocky Mountain Training