Re: Highlighting scripts Posted by Gail on Mar 04, 2012
Success. I got a macro to bold and highlight all lines for any character name I input in a prompt box.  My son who is studying programing helped me get the last little script to work.  I made a sample script doc with the macro VBA incase anyone else can use this.  I am not sure how to attach a Word doc to this post.  What do you suggest, should I put the VBA code in the post? It is pretty short for code.
Re: Highlighting scripts Posted by Ron Arnold on Mar 04, 2012
You can add code using the # button when you post, it says code when you hover over the button.
Re: Highlighting scripts Posted by Gail on Mar 04, 2012
Ok Here goes.[code]Sub Highlt()
'
' Highlt Macro'
'Macro to add Bold and yellow highlight to all of one character's lines
‘in Word puppet script that runs by assigned shortcut Ctrl+h
    Dim strName As String
    strName = InputBox("Enter Character Name:", "CHARACTER NAME")
    Selection.HomeKey Unit:=wdLine
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Highlight = True
    Selection.Find.Replacement.Font.Bold = True
    With Selection.Find
        .Text = strName & ":*" & Chr(13)
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute
    Options.DefaultHighlightColorIndex = wdYellow
    Selection.Range.HighlightColorIndex = wdYellow
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Highlight = True
    Selection.Find.Replacement.Font.Bold = True
    With Selection.Find
        .Text = strName & ":*" & Chr(13)
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Highlight = False
    Selection.Find.Replacement.Font.Bold = True
    With Selection.Find
        .Text = ":  "
        .Replacement.Text = ":  "
        .Forward = True
        .Wrap = wdFindAsk
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
[/code]
Re: Highlighting scripts Posted by Gail on Mar 04, 2012
I searched for a way to replace the too dark highlight colors with the lighter shading but have not found a way so I recorded the macro with yellow highlight as it is the only highlight color you can read after printing very well.  This code relys on the writer using colon and two spaces after the character name to find the start of the line.  Also relys on writer not using the carraige return until the very end of the character's line, let the text wrap to next line.  I like to use hanging indent to off set the body of text so the character names only show in the left margin.  I also removed the highlighting on the colon and the two spaces to separate the name from the line. We don't like to have double spaced lines so we won't have to roll our scripts as often. We rely on the bold and highlight to separate and identify our lines.  Hope this is helpful to someone else,it is going to save me a couple of hours each week.
Re: Highlighting scripts Posted by Na on Mar 05, 2012
Thanks for posting the code, I'm sure someone somewhere out there will find that useful!
Re: Highlighting scripts Posted by Shawn on Mar 05, 2012
Cool!  Not real sure why the code has to do three finds but then VBA is not my strong point. Glad you had your son was around to help out.
Re: Highlighting scripts Posted by Puppetainer on Mar 05, 2012
It sounds like you've found a solution to your problem but I still wanted to put a plug in for the software I have used when writing scripts. Celtx is an open source software that is a GREAT tool for scriptwriting! I don't know that it will highlight a single character's lines for you but it does SOOOOOO much other stuff that I would still strongly urge you to take a look at it.

When I used it we just did the same thing I've done in many theater productions. During our table read each actor highlights their lines as we're going. Okay, I always go through my script before hand just so I'm ready but you get the idea. I guess I didn't see it as an inconvenience as it's the way I've done it in the past.

In any case give Celtx a look and best of luck with your production!
Re: Highlighting scripts Posted by Na on Mar 05, 2012
I wonder what the time difference is: more time spent vs less time spent.

Is coding a macro more time-consuming than manually highlighting by individual actors, or the other way around?
Re: Highlighting scripts Posted by Puppetainer on Mar 05, 2012
Good question Na!
Re: Highlighting scripts Posted by Gail on Mar 05, 2012
That macro was recorded, you just turn on the macro recorder and do the motions and it writes the code.  It only took a few minutes. I don't know how to write whole code but I can go in and tweak it to do something slightly different after recording. The hard part is to think of a way to do the formats in a relative fashion so that they will work on any script. I found that using key strokes and short cuts rather than using the mouse work better in recording macros. I found the VBA code to add the input box on line, you can find lots of code that way,and my son figured out how to insert it in the recorded code.  It is always little symbols that cause the problems so he tried several variations until one worked.  Dumb luck but it worked.

Also I really wanted it grey shading and my son said to print in grey scale and the yellow highlight is light grey just like I wanted. He is so smart.

Shawn, I had another find and replace to inset blank spaces after the name. It may have to do with me leaving the find dialogue box and going to choose the highlight color and returning to the find box. 
Loading

No More Post

Error