A few of our editors are looking for a way to have a predetermined line of text added to a story via a shortcut key. For example "if you would like to comment please write us at example@eg.com". We are using XP pro and InCopy CS5. I'm not familiar with scripting but if there is a way to do it using scripts I am not opposed to learning it.
This one-line script does that:
app.selection[0].insertionPoints[0].contents="if you would like to comment please write us at example@eg.com";
Then, you can assign it a key in Edit > Keyboard Shortcuts in the Scripting area.
There is no need for a script for that. The built-in Text Macro feature does exactly what you're asking about. It's a place where you can add "boilerplate" text and recall it by double-clicking its entry on the Text Macro panel, or using a keyboard shortcut (which you add in the Text Macro pane, not Edit > Keyboard Shortcuts), or by typing a macro code of your own devising right in the text, like an auto-expand code.
Just type out the text you want to turn in to a Text Macro, select it, and click the New Macro button in the Window > Text Macro panel. You can choose your macro code and/or a keyboard shortcut there, and you can choose whether or not to retain the formatting (text style) of the selection.
There is no size/length limit to the macro. It could be a simple expansion of an acronym, a sentence (like you want), a paragraph (like an author bio or your address), or an entire story.
Details here: http://help.adobe.com/en_US/incopy/cs/using/WSa285fff53dea4f8617383751 001ea8cb3f-72bda.html
... or in any of my InDesign/InCopy Workflow videos on Lynda.com
AM
There is no need for a script for that. The built-in Text Macro feature does exactly what you're asking about. It's a place where you can add "boilerplate" text and recall it by double-clicking its entry on the Text Macro panel, or using a keyboard shortcut (which you add in the Text Macro pane, not Edit > Keyboard Shortcuts), or by typing a macro code of your own devising right in the text, like an auto-expand code.
Oh, that's a good point! I somehow always forget about this feature because it strangely does not exist in InDesign.
It's the better bet here!
Sorry about that.
The macro function is easier to manage. It's easier to edit, in a panel, and it's easier to handle multiple items and see what they are. It also handles text attributes much better -- if you want to have italics, boldface, or other attributes, they require complicating the script substantially, but the Text Macro feature just handles them.
North America
Europe, Middle East and Africa
Asia Pacific