home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / batchfactory / scripts / par / par_to_iff24_frames < prev    next >
Encoding:
Text File  |  1995-01-12  |  2.3 KB  |  88 lines

  1. /* 
  2.                         PAR CREATE IFF FROM STILLS
  3.                                By J.L. White
  4.                           ©1994 Merlin's Software
  5.  
  6.              Takes PAR Stills & Converts Them To IFF24 Images
  7.                     Personal Animation Recorder Script
  8.                       Requires The Rexxarplib.library
  9.  
  10.  Batch Factory Batch Conversion Scripts are basically Arexx scripts that
  11. allow you to pass certain parameters to the external program you wish
  12. to use to convert the images from one format to another. You can pass
  13. five different strings from Batch Factory to the script by using the
  14. following commands:
  15.  
  16. $N = This will pass the current selected filename.
  17. $P = This will tell Batch Factory to ask for a path to save new frames to.
  18. $# = This will pass the current frame number in the script.
  19. $T = This will pass the total number of frames in the script.
  20. $A = This will pass an offset number to be used to save frames with.
  21.  
  22. NOTE: The following line is required to work as a Batch Factory Script:
  23.  
  24. PARSE=$N $# $T
  25.  
  26. */
  27.  
  28. arg InFile FileNum TotalNum
  29. options results
  30. if ~show('l', "rexxarplib.library") then do
  31.     check = addlib('rexxsupport.library',0,-30,0) 
  32.     check = addlib('rexxarplib.library',0,-30,0)   
  33.     end
  34. PName = "Batch"
  35.  
  36.  
  37. Top = 170
  38. Height = ScreenRows(PName)
  39. if Height < 400 then Top = 70
  40. call Locate_PAR
  41.  
  42. if FileNum = 1 then do
  43.     result = GetFile(165,11,"RAM:","","Select Path To Copy Files To!","Batch",NOFILES,,,Height-35)
  44.     address "DDR"
  45.     Path result
  46.     Emode Frame
  47.     Exporter IFF
  48.     PathName = GetPathName(InFile)
  49.     ProjectName = GetProjectName(PathName)
  50.     NameLength = Length(ProjectName)
  51.     ProjectName = left(ProjectName,NameLength-1)
  52.     Project ProjectName
  53.     end
  54. address "DDR"
  55. FrameName = GetFileName(InFile)
  56. File FrameName
  57. Export
  58. exit
  59.  
  60. Locate_PAR:
  61.     if (POS('DDR',SHOW('Ports')) = 0)
  62.     then do
  63.         call Request(180,Top-14,"Can Not Locate The PAR Software\Please Abort Script & Try Again!",,"OK",,PName)
  64.         address command "Wait 3"
  65.         exit
  66.     end
  67. return
  68.  
  69.  
  70.  
  71. GetFileName: procedure  
  72.    ARG CompleteName
  73.    c = lastpos("/",CompleteName)
  74.    if c = 0 then c = lastpos(":",CompleteName)
  75.    return substr(CompleteName, c + 1)
  76.  
  77. GetPathName: procedure  
  78.    ARG CompleteName
  79.    c = lastpos("/",CompleteName)
  80.    if c = 0 then c = lastpos(":",CompleteName)
  81.    return left(CompleteName,c)
  82.  
  83. GetProjectName: procedure  
  84.    ARG CompleteName
  85.    c = lastpos(":",CompleteName)
  86.    return substr(CompleteName,c+1)
  87.  
  88.