Shortcut for Variable?

Hello

I created the custom text variable. I want here and there to put this text in the middle of a text.

Is there a way to create keyboard shortcut for "Insert?" variable

Thank you

Ran

Brings back memories of WordPerfect, which allow you to define all kinds of quick shortcuts. Here is a take on that. Two scripts: one to define keys, the other to use shortcuts.

// Select some text, then run this script. Enter a number between 0 and 9 inclusive.
// The script creates a custom text variable with the name 'QuickVar' followed by the number
// using the text selected in the document

if (app.selection.length > 0 && app.selection[0].hasOwnProperty ('baseline')) {
  x = prompt ('Enter a number (0-9):', '0', 'Quick var');
  if (/^[0-9]$/.test(x)) {
    if (app.documents[0].textVariables.item('QuickVar'+x).isValid) {
      app.documents[0].textVariables.item('QuickVar'+x).variableOptions.contents = app.selection[0].contents;
    } else {
      app.documents[0].textVariables.add ({
        name: 'QuickVar'+x,
        variableType: VariableTypes.CUSTOM_TEXT_TYPE,
        variableOptions: {contents: app.selection[0].contents}
      });
    }
  }
}

To use the text with a shortcut key variable, save this script in your scripts folder, for example by using the name of the variable (but it can be any name), using the jsx file type: quickvar0.jsx

if (app.selection.length > 0 && app.selection[0] instanceof InsertionPoint) {
  app.selection[0].textVariableInstances.add ({associatedTextVariable: app.activeDocument.textVariables.item ('QuickVar0')});
}

(You might as well copy the script to quickvar1.jsx, quickvar2.jsx, etc.) Do not forget to change the name of the variable in the script.)

By pressing the key shortcut inserts the contents of the variable at the insertion point.

Peter

Tags: InDesign

Similar Questions

  • Y at - it a keyboard shortcut for "close all tabs in the right" and "close other tabs" actions? Thank you.

    Y at - it a keyboard shortcut for "close all tabs in the right" and "close other tabs" actions? Thank you.

    As far as I know that there is no shortcut pre-defined for this task. You can always check for the shortcut available in this list: hotkeys - quickly perform common tasks of Firefox

    However, you can set your own shortcut using this addons: https://addons.mozilla.org/en-US/firefox/addon/customizable-shortcuts/

  • Keyboard shortcut for "Clear downloads" in the library?

    Is there a keyboard shortcut for "Clear downloads" in the library? It's a bit annoying to have to click on the button when almost everything else, "Organize" as has shortcuts.

    CTRL + a to select all
    del to remove selected entries

  • How to display a shortcut for gmail on desktop! ?

    I can't seem to find a way to place a shortcut for gmail on the desktop homepage (never had this problem before)

    Hello

    Please try this: left click, hold and drag the favorite mail icon google.com on it, between the left edge of the location (address) bar and release it on the desktop.

  • Accessibility: why is there no shortcut for Page Info in Windows?

    On Linux and Mac, there is a keyboard shortcut for Page Info:
    Linux: ctrl + I
    Mac: cmd + I
    but there is no shortcut for Windows relatives, we are forced to use a mouse. An extension should not be required for basic accessibility features.

    I agree that a keyboard command to open the Info Page on the Windows of Firefox versions should be standard, but unfortunately {Ctrl + I} always open the bookmarks bar, which cam also open with {Ctrl + B}.

    I have been using the extension of Page Info button to add this feature to Firefox since Firefox 1.0.
    https://addons.Mozilla.org/en-us/Firefox/addon/page-info-button/?src=SS

  • keyboard shortcut for a retail setting "preferences".

    A few sites I use often are difficult to read in their own colors, then I go to 'Edit-> Preferences-> content-> colors' and uncheck "Allow pages to choose their own colors, instead of my selections above".
    Other sites need this setting checked in order to work correctly.
    I can create a keyboard shortcut for this setting?

    FF 4.0.1 on Windows XP and Linux

    Specifically for this and because it can be changed via the options, you can create a toolbar button to do this.

    Manufacturer of custom toolbar buttons , select "Enable/disable Page colors", install, move the button custom toolbar. Active / disable preferences, removes some but not all images (loses the banner entire mozillaZine exactly the same as the preference). Another button that can be included is 'Font of Page', which activates / turns off page fonts between your colors and colors on the web page. Another button which may be necessary to read some pages is "Toggle Styles" to disable CSS styles or save on.

    See also the page where the above come, other suggestions:

    Please mark "resolved" a response that will better help others with a similar problem - hope it was her.

  • I want a keyboard shortcut for "home". Where is this shortcut key for 'home '?

    See, so far I understand that there is no function of customizable shortcut for Firefox.

    But you couldn't just add a shortcut of the button "home"? CTRL + Space for example. Then one could easily spend for example access to their favorite search engine.

    CTRL + K or CTRL + E

    See hotkeys - quickly perform common tasks of Firefox

  • Y at - it a keyboard shortcut for 'Pin as App tab '?

    Sometimes (especially with a touchpad) move the cursor of the mouse on the tab, right click and choose 'Pin as App tab' is a lot of work compared to using a keyboard shortcut. Y at - it a keyboard shortcut to do this?

    There is no keyboard shortcut for this.

  • Y at - it a keyboard shortcut for switching windows?

    I see that there is a keyboard shortcut for switching tabs in a window of Firefox, but I would also like one to switch between the windows of the browser. I guess it's easier on Windows, where each browser window kind of behaves as an application separate, but on the Mac OS, an application can have multiple windows. Thus, the operating system does not provide supported to switch between browser windows via a keyboard shortcut; It allows to switch between applications, which brings all of the windows in the application target forward.

    To switch between using Firefox windows: Cmd (Shift) + ~ (Tilde)

    See http://www.danrodney.com/mac/#windows

  • What is a keyboard shortcut for the window active expansion/contract?

    What is the shortcut for maximize/minimize the active window?

    Open the system menu with Alt + space N

  • Is there a keyboard shortcut for automatic speed?

    I often use automatic speed and I can't seem to find the shortcut for it.

    FCPX 10.2

    Different from no default shortcut, but you can customize the keyboard to create your own.

  • How to create a shortcut for deleting the photos

    Every time when I want to delete a photo from my library of Photos, I confirm that I want to delete this photo. It is exactly 1 click or hit on the keyboard too. I was looking to create a keyboard shortcut for this, but I can't find the "right" of the menu command name. I thought it was 'Delete 1 Photo' but the keyboard shortcuts in the system preferences panel, I cannot type anything in there. Anyone know? And anyone know where I can find this command text so that in the future it can help me so look for other commands?

    See you soon!

    If you use the keyboard shortcut command + DELETE ⌘⌫, will remove pictures of moments politicians or any album without no questions asked.  This shortcut should already be defined.

  • Keyboard shortcut for the alignment of the window

    Recently, migration from Windows to OS X, I realize account there is no keyboard shortcut for the alignment window to the left or to the right. Or, is it? There are third-party applications that support this feature?

    Thank you.

    Using OS X El Capitan

    You could try the best Snap tool.

    https://iTunes.Apple.com/au/app/bettersnaptool/id417375580?MT=12

    I have not used it myself, but the description seems to describe the feature you request.

  • Is there a keyboard shortcut for the House in the mail?

    By clicking on the Home icon is an easy way to return to the display of the Inbox.

    But I can't find a keyboard shortcut for the House (and it doesn't seem to be a complete list of hotkeys for messaging).

    Have you tried fn + left arrow keys?

  • Y at - it a keyboard shortcut for 'pause' and 'summary '?

    I searched carefully but did not find such a shortcut. Y at - it a keyboard shortcut for 'pause' and 'summary' on the window of LabVIEW?

    Hi Finkler,

    If you use a debugging feature! And no, there seems to be no assigned shortcut key.

    When you need a VI with the possibility of "break" you should learn about state machines. They are a common system to integrate these 'States' as a 'Performance' or 'pause' in a VI (or the program in general)...

Maybe you are looking for

  • Toshiba eStudio - electronic filing service - print all?

    Hello We have a 5055c eStudio in a workgroup environment and seeking to implement electronic filing for the printing of documents for storage. The feature works well, but I was wondering if there was a way to select multiple documents to print at onc

  • Office games

    Hi melvillebrown, Thank you for using answers Forum. I'm not able to access your computer remotely.Have set you the program associations recently, before this problem? Do you have created shortcuts to the Vista games on your desktop?Box menu, do you

  • I have a Compaq Windows XP and I can not open my hard drive.

    I opened the outer hatch, but the hole for the paper clip thing does not work and whenever I press the button it lights up but made a push and I can't open it. Please help me

  • Missing driver Pack for HP Probook 440 G1

    I use HP Softpaq Download Manager and HP Probook 440 G1 is listed under Build Driver pack but no softpaqs are available for the operating system. I'm looking for the driver Windows & pack 32 bit for SCCM 2012.

  • How can I get image files, in a folder in alphabetical order?

    Can someone tell me how to put a section of photos that I keep in a folder in my pictures in alphabetical order. They are all appointed, but can't seem to get in order. I use Vista. See you soon... Moved from feedback Original title: photos