2 Replies Latest reply on Feb 25, 2008 1:13 PM by (Sera_Stack)

    [VB] Help with the Find/Change function

      Hello,

      I'm just getting started with using scripts and although I've read through the tutorials on the InDesign scripting page, I'm still having a problem with my CS3 script. I'm hoping someone here can help me with it.

      Firstly, I've been making a script to search for text styles and replace them with character files. I've done fine with bold and italic, but I can seem to get the syntax right for superscript. Here's what I have at the minute:

      Set myInDesign = CreateObject("InDesign.Application.CS3")
      myInDesign.FindTextPreferences = idNothingEnum.idNothing
      myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
      myInDesign.FindChangeTextOptions.CaseSensitive = false
      myInDesign.FindChangeTextOptions.IncludeFootnotes = false
      myInDesign.FindChangeTextOptions.IncludeHiddenLayers = false
      myInDesign.FindChangeTextOptions.IncludeLockedLayersForFind = false
      myInDesign.FindChangeTextOptions.IncludeLockedStoriesForFind = false
      myInDesign.FindChangeTextOptions.IncludeMasterPages = false
      myInDesign.FindChangeTextOptions.WholeWord = false
      myInDesign.findTextPreferences.Position = "Superscript"
      myInDesign.ChangeTextPreferences.AppliedCharacterStyle = "Superscript"
      myInDesign.documents.item(1).changeText
      Rem Clear the find/change preferences after the search.
      myInDesign.FindTextPreferences = idNothingEnum.idNothing
      myInDesign.ChangeTextPreferences = idNothingEnum.idNothing

      I've tried a number of variations, but I can't seem to nail Superscript.