Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
PrintOmatic lite behavior
Game protector
Rollover Swirl-Alphamania
Mosaic-Alphamania
Macromedia Director 7 Lingo training CD
PopUp Menu
Inspect
Deleting a range of frames
Font Pool
Control direction of velocity
 

 

 

Behavior Export/Import Text and Filed Members for proofing

Added on 10/2/2000

 

Compatibilities:
behavior D7 D8 PC

Required Xtras:
Buddy API

This item has not yet been rated

Author: MediaMacros (website)

This is a little utility to allow you to export all text and field members to a text file for simple proofing, then with one command, pull them all back in. It works like so... exportText(fileNameOfNewFile, listOfCastlibsToUse) Example... exportText("C: ext.txt", [1,2,4]) This would export all text and field members in casts 1,2 and 4 to a file named c: ext.txt. To pull it back in just do this... importTextBack(fileToImport, listOfCasts) While editing, be sure not to remove any of the key names (1=, etc) as they are necessary to ensure that every line gets put back in the correct place.

on exportText whatFile, libList
  if libList.count > 0 then
    repeat with y = 1 to libList.count
      repeat with x = 1 to the number of members of castLib y
        if member(x,y).type = #text or member(x,y).type = #field then
          if member(x,y).text.lines.count > 0 then
            repeat with z = 1 to member(x,y).text.lines.count
              newText = member(x,y).line[z]
              baWriteIni( string(x) & "-" & string(y), string(z), newText, whatFile)
            end repeat
          end if          
        end if
      end repeat  
    end repeat
  end if
end

on importTextBack whatFile, libList
  if libList.count > 0 then
    repeat with y = 1 to libList.count
      repeat with x = 1 to the number of members of castLib y
        if member(x,y).type = #text or member(x,y).type = #field then
          loopIt = true
          lineNum = 1
          newText = ""
          repeat while loopIt = true            
            lineText = baReadIni( string(x) & "-" & string(y), string(lineNum), "MeEmpty", whatFile)
            put lineText
            if lineText <> "MeEmpty" then
              newText = newText & lineText & return
              lineNum = lineNum + 1
            else
              if newText <> "" then
                member(x,y).text = newText
              end if
              loopIt = false
              exit repeat
            end if
          end repeat
        end if
      end repeat  
    end repeat
  end if
end

on getBehaviorDescription me
  describe = "This is a little utility to allow you to export all text and field members to a text file for simple proofing, then with one command, pull them all back in.  It works like so..." & return & "exportText(fileNameOfNewFile, listOfCastlibsToUse)" & Return & "Example..." & return & "exportText("& quote & "C: ext.txt" & quote & ", [1,2,4])" & return & "This would export all text and field members in casts 1,2 and 4 to a file named c: ext.txt."  & return & "To pull it back in just do this..." & return & "importTextBack(fileToImport, listOfCasts)" & return & "While editing, be sure not to remove any of the key names (1=, etc) as they are necessary to ensure that every line gets put back in the correct place."
  return describe
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail