Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
As the message says: select an insertion point. In other words, click in the text where the anchor should be placed.
Copy link to clipboard
Copied
I did that again and again before and after the message and still get:
Copy link to clipboard
Copied
Then you probably don't have an object style defined. The error message is too general, it's not just about the selection. So here is a different version of the script.
Again, insert the name of your object style. Where it says van name = 'xyz' replace xyz with the name of your style.
(function () {
var name = 'xyz';
var ostyle = app.activeDocument.objectStyles.item (name);
if (!ostyle.isValid) {
alert ('The object style ' + name + ' does not exist');
exit();
}
if (app.selection.length === 0
|| !(app.selection[0] instanceof InsertionPoint)) {
alert ('Select an insertion point');
exit();
}
var tf = app.selection[0].textFrames.add ({
appliedObjectStyle: ostyle
});
tf.insertionPoints[0].select();
}());
Find more inspiration, events, and resources on the new Adobe Community
Explore Now