Final Import Media Handler

Date:    Mon, 21 Nov 1994 19:15:13 -0800
From:    Miles Lightwood 
Subject: FinalImportAll handler...
Here is my version of John Dowdell's FinalImport utility handler, complete with preserved reg points, palletes, purge priorities, etc.

This is my version of John Dowdell's FinalImport utility handler. This one improves upon his by importing PICT, sound, and .dir movies. The reg point palette, purge priority, and, script text of the linked file are preserved. It also specifies the file name and castnumber of the imported file, and writes this to a report file. I'm posting it so that everyone can use it. Please feel free to modify it as you see fit.

 

--**************************************************************************
--*                                                                         
--*                                 NOTE:                                   
--*         THIS HAS ONLY BEEN TESTED WITH DIRECTOR 4.0.3 MACINTOSH.        
--*    RESULTS WITH OTHER VERSIONS AND PLATFORMS HAVE NOT BEEN DETERMINED.  
--*                           USE AT OWN RISK.                              
--*                                                                         
--**************************************************************************

 
on FinalImportAll
  -- Put this in a Movie Script. Call it from the message window.
  -- Depending upon how many cast you will be importing, this
  -- could take quite a while to execute. Be patient. You also might want to try
  -- this first on a sample movie to see how it works. This is a utility handler
  -- that can be used as the last stage in production, to bring all linked m edia
  -- into the Director movie itself.
 
  --*  This  "if" imports PICT cast.
  repeat with i = 1 to the number of castmembers
    if the fileName of cast i <> "" then
      if the castType of cast i = #bitmap then
        set myName = the name of cast i
        set myScript = the scriptText of cast i
        set myRegPt = the regPoint of cast i
        set myPurgePriority = the purgePriority of cast i
        set myPalette = the palette of cast i
        importFileInto cast i, the fileName of cast i
        set the name of cast i = myName
        set the scriptText of cast i = myScript
        set the regPoint of cast i = myRegPt
        set the purgePriority of cast i = myPurgePriority
        set the palette of cast i = myPalette
        put "Imported PICT cast number " & i & "," && the name of cast i & "," & " sucessfully."
      end if
    end if
 
    --* This "if" imports Sound cast.
    if the fileName of cast i <> "" then
      if the castType of cast i = #sound then
        set myName = the name of cast i
        set myScript = the scriptText of cast i
        set myPurgePriority = the purgePriority of cast i
        importFileInto cast i, the fileName of cast i
        set the name of cast i = myName
        set the scriptText of cast i = myScript
        set the purgePriority of cast i = myPurgePriority
        put "Imported Sound cast number " & i & "," &&  the name of cast i & "," & " sucessfully."
      end if
    end if
 
    --* This "if" imports Director movie cast.
    if the fileName of cast i <> "" then
      if the castType of cast i = #movie then
        set myName = the name of cast i
        set myScript = the scriptText of cast i
        set myPurgePriority = the purgePriority of cast i
        importFileInto cast i, the fileName of cast i
        set the name of cast i = myName
        set the scriptText of cast i = myScript
        set the purgePriority of cast i = myPurgePriority
        put "Imported Director movie cast number " & i & "," &&  the name of cast i & "," & " sucessfully."
      end if
    end if
  end repeat
 
  --* I'm not sure how to write the results in the message
  -- window to a report file; I'm using the traceLogFile to  
  -- no success. I'm also having difficulty
  -- concatenating the report file name and the variable
  -- dateTime, and then using the string as the report name.
  -- Here's what I have so far. Any suggestions?
  put the short date into date
  put the short time into time
  put date & "," & time into dateTime
  set the traceLogFile = "Import Report" & dateTime
  set the traceLogfile = ""
end