8 Replies Latest reply on May 21, 2006 3:02 AM by andyulrika_is_back

    Margins Creating a Lot of Used Tea Bags

    andyulrika_is_back
      Hello

      I am pasting a large amount of text snippets into one of my movies so that I can have a word glossary. Each text member will eventually be a URL going to various parts of other movies. There are currently around 400 words I have to paste into the cast. I then have to adjust the font, which is easy to do in the Text Inspector but I have to manually adjust every margin of the text members.

      Is there any other easy way to do this or should I look out some more music CDs to continue the job until the end of time?

      Any help much appreciated.

      Andy
        • 1. Re: Margins Creating a Lot of Used Tea Bags
          Level 7
          You can probably walk through the text members and set the properties
          that you want using Lingo. Setting font, size, color, etc. is a trivial
          task for a function.

          I don't know what you are attempting to do with margins, but it should
          be possible to automate that process also.

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: Margins Creating a Lot of Used Tea Bags
            Level 7
            On Wed, 17 May 2006 18:38:19 GMT, Rob Dillon * ACE* posted in
            macromedia.director.lingo:

            > You can probably walk through the text members and set the properties
            > that you want using Lingo. Setting font, size, color, etc. is a trivial
            > task for a function.
            >
            > I don't know what you are attempting to do with margins, but it should
            > be possible to automate that process also.

            Also, if you're not comfortable writing a lingo script, the slower method
            (similar to what you're probably doing now) would be to duplicate the cast
            member before pasting the text in. Just select the cast member, hit Ctrl+D,
            paste the text - and probably give it a new name, too.

            If you do write a script, it could also provide unique names for all of these
            cast members. Or write one that duplicates your first cast member as many
            times as needed while giving unique names to them. Then paste into them.

            However, if you're copying from Word, you might want to paste that whole doc
            into a plain text file and copy from there before pasting into Director. I
            think that sometimes Dir text members get MS Word attributes.


            --
            Mark A. Boyd
            Keep-On-Learnin'
            • 3. Re: Margins Creating a Lot of Used Tea Bags
              andyulrika_is_back Level 1
              Thanks Rob and Mark for your comments.

              I don't think I've explained myself clearly. Apart from all the things you can do to text like font, size and colour etc. What I am complaining about is the margins which have to be set manually for each cast member.

              e.g. Let's say I want to paste 10 words into the cast from Word - First, I highlight the text then copy and paste the word into the cast.
              I want the margins to be the size of the word so I have to manually change the size of the margins to fit. This is my gripe!

              What I am effectively looking for is a kind of margin wrap. Could a script be written to deal with that? Or, is there something I've missed in Directors features? Or, get the wife to do this mundane task.

              regards

              Andy
              • 4. Re: Margins Creating a Lot of Used Tea Bags
                Chunick Level 3
                the gripe is a tad unwarranted... The margins are set based off of the page settings in Word and not from the general text formatting so I wouldn't make the assumption they would carry over from a copy/paste action. I would take the suggestion by one of the previous gentlemen responders and write a script to make the necessary adjustments so it looks exactly how it did in Word.
                • 5. Re: Margins Creating a Lot of Used Tea Bags
                  a¿ex Level 1
                  quote:

                  Originally posted by: andyulrika
                  Could a script be written to deal with that?


                  I think so, yes.
                  I didn't understand exactly, what you're after, though.
                  Do you want to change the width of the text member, so that the contents fit closest as possible in one line?
                  Or do you really mean the margin, which would be leftindent and rightindent?
                  It seems, that you simply want to adjust the width of the member.
                  easiest would be to make the width something very large, then get the value for the locH of the last char.

                  on mAdjustTextMemberSizeToSingleLine textmember, maxWidth
                  textmember.width = maxWidth
                  firstloc = textmember.charPosToLoc(1)
                  endLoc = textmember.charPosToLoc(length(textmember.text) + 1)
                  if firstloc[2] = endLoc[2] then textmember.width = endLoc[1] + 1
                  else put "Member" && textmember && "has more than one line"
                  end

                  -- now if you want to do that to all selected castmembers, try:

                  on mAdjustSelectedTextMembersToSingleLine
                  cl = the activecastlib
                  sel = the selection of castlib cl
                  repeat with sub in sel
                  repeat with mem = sub[1] to sub[2]
                  memref = member(mem,cl)
                  if memref.type = #text then
                  mAdjustTextMemberSizeToSingleLine memref, 500
                  end if
                  end repeat
                  end repeat
                  end



                  If it isn't the width you're after, than try textmember.rightindent instead of width.

                  HTH
                  • 6. Re: Margins Creating a Lot of Used Tea Bags
                    andyulrika_is_back Level 1
                    Hi

                    Sorry if I still haven't explained what I'm looking for but you hit the nail on the head - Do you want to change the width of the text member, so that the contents fit closest as possible in one line?

                    Thank you for the script, however I was unable to get it working - could you tell me exactly what I should do - I am no Director expert.

                    Help much appreciated.

                    Andy
                    • 7. Re: Margins Creating a Lot of Used Tea Bags
                      a¿ex Level 1
                      quote:

                      Originally posted by: andyulrika
                      Thank you for the script, however I was unable to get it working - could you tell me exactly what I should do - I am no Director expert.


                      You need not be a Director expert to know, what to do with the snippet, a basic knowledge would do :-P
                      It would be very helpful, if you would try to explain your problems a little bit better than a simple "it doesn't work".

                      I posted 2 handlers.
                      - copy them into the clipboard
                      - make a new script
                      - paste the contents of the clipboard into the new created script as scripttext.
                      - close the script castmember
                      - activate the Proprty Inspector, choose the "Script" tab and make sure for the value for "Type" is "Movie"
                      - now select the range of members you want to resize (use the Shift-key or the Cmd-key for multiple selections)
                      - open the message window and type "mAdjustSelectedTextMembersToSingleLine" without the quotes and hit the RETURN key


                      the handler loops through the selected members of the selected castlib and if a member is of type #text, it calls the handler "mAdjustTextMemberSizeToSingleLine" to resize the member.
                      • 8. Re: Margins Creating a Lot of Used Tea Bags
                        andyulrika_is_back Level 1
                        Hello a¿ex

                        Firstly, this script worked perfectly and has saved me a hell of a lot of work - Thank you for your help!

                        Sorry I hadn't given a clear explanation of my initial problems and 'not working' is pretty poor, even by my standards!

                        Thanks all for your input. Time for a coffee.

                        regards

                        Andy