Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Add document dimensions User as a text variable

Return to Member Forum

  • Author
    Posts
    • #59131
      nellbern
      Member

      Is this is possible?

      – In the slug area have a variable with the actual document dimensions of the document. I tried to define one using Type: Metadata Captions then Metadata: Dimensions. I can see a preview but obviously it is not working.

      – A custom variable with the name of the User.

    • #59133
      David Blatner
      Keymaster

      No, unfortunately I don't think either of those are possible in ID. Perhaps with a script or plug-in that I don't know of.

    • #59141

      CS5's automatic Metadata variables do not reflect the InDesign document's properties, only that of imported images. (That said: I shudder at the thought, but what do they say about a placed InDesign document!?)

      But it sure is possible to script this, although the changes will not be “live” — each time you change the dimensions or user, you have to re-run the script.

      First create two variables, both of type “Custom text”. Name one “Dimensions” and the other “User”, and insert these whereever you want. Then run this Javascript to set (and re-set) the contents:

      v = app.activeDocument.textVariables.item(“Dimensions”);
      if (v.isValid && v.variableType == VariableTypes.CUSTOM_TEXT_TYPE)
      v.variableOptions.contents = Math.round(100*app.activeDocument.documentPreferences.pageWidth)/100+” x “+Math.round(100*app.activeDocument.documentPreferences.pageHeight)/100;
      else
      alert ('Variable “Dimensions” doesn't exist or is of the wrong type');
      v = app.activeDocument.textVariables.item(“User”);
      if (v.isValid && v.variableType == VariableTypes.CUSTOM_TEXT_TYPE)
      v.variableOptions.contents = app.userName;
      else
      alert ('Variable “User” doesn't exist or is of the wrong type');

Viewing 2 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads