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

script for finding vertical scale of type

Return to Member Forum

  • Author
    Posts
    • #64019
      kdnsmandel
      Member

      My company uses horizontal scaling of type quite a bit. But occasionally, as we are resizing ads, some type gets accidentally scaled vertically, which we consider a no-no.

      I can't use a custom preflight profile because it searches for all scaled type, not vertical or horizontal specifically.

      I can't use GREP because there is no code for vertically scaled type.

      So I think I'm left with a script, but I'm far from an expert. Does anyone know of a script I could use, or modify?

      I think I specifically need the line/lines of code that searches for vertical scale less than 100% and greater than 100%, or something to that effect.

      Any help would be greatly appreciated!

    • #64020

      Finding stuff is relatively easy with a script, but it's quite hard to make it 'interactive'. That is, if you need functionality such as 'find next', 'find in current story', or even 'find previous' (a function that Adobe feels unnecessary, even in CS6), one needs a large script.

      In addition, just like in the UI, you cannot do a plain search for “not x“. You must inspect every single item, one at a time.

      If you only need to find the very next occurrence and you always correct it immediately, then you could use this:

      cstyles = app.activeDocument.stories.everyItem().textStyleRanges.everyItem().getElements();
      for (i=0; i!=cstyles.length ;i++)
      {
      if (cstyles[i].verticalScale != 100)
      {
      app.select(cstyles[i]);
      app.layoutWindows[0].zoomPercentage = app.layoutWindows[0].zoomPercentage;
      }
      }

      … It always restarts searching from the very start of your document, so if you leave even just one occurrence unchanged, the script will always stop at that point.

      Do you reset the vertical scale to 100%? I imagine you don't, since the horizontal scale should also be adjusted. But if you do, you could replace the inner two commands with this single one:

      cstyles[i].verticalScale = 100;

      .. although the end result is not different from “Select All” and then setting the vertical scale for all text at once ..

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Forum Ads