home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDG-CT1.DMS / in.adf / CT.run / Scripts / 1 / Frames / Clips / FramesToStills < prev    next >
Encoding:
Text File  |  1995-08-24  |  4.3 KB  |  200 lines

  1. /*
  2.                         Control Tower Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1995 Merlin's Software
  5. Lines=8
  6. 01=Frames To Stills
  7. 02= 
  8. 03=This script takes frames and creates
  9. 04=flyer stills from each. This makes it
  10. 05=very easy to take Framestores or RGB
  11. 06=files and convert them into stills 
  12. 07=which take up less space on your Hard
  13. 08=Drive and load much faster.
  14. */
  15.  
  16.  
  17. parse arg InFile FileNum TotalNum FrameRepeat WhichScript TotalScript Times Select
  18. signal on error
  19. signal on syntax
  20. options results
  21. InFile = Translate(InFile," ","ยค")
  22. DriveName = FindDrive()
  23.  
  24. if FileNum = 1 & WhichScript = 1 then do
  25.     Address CT_1 GetCompressionNT
  26.     Compression = result
  27.     Type = YesOrNo("Use FileNames Or Select New Names For Stills?"," FILENAME "," NEW NAME ")
  28.     if Type = 1 then do
  29.         do i = 1 to Times
  30.             blank = "Select Path For Stills Collection #"i"!"
  31.             OutFile.i = GetPath(blank,DriveName)
  32.             DriveName = GetPathName(OutFile.i)
  33.             end
  34.         end
  35.     else do
  36.         OutFile.1 = "NewName"
  37.         do i = 1 to TotalNum
  38.             x = i-1
  39.             Address CT_1 GetScriptFileName x
  40.             Name = result 
  41.             NewName = GetFileName(Name)
  42.             blank = "Enter New Name For "NewName"!"
  43.             StillName.i = GetFile(blank,DriveName)
  44.             NewName = GetFileName(StillName.i)
  45.             if NewName = "" then do
  46.                 Address CT_1 OK_TEXT " OK "
  47.                 Title = "You Must Enter A Valid Path & Name For Stills!"
  48.                 Address CT_1 FYINT Title
  49.                 Address CT_1 Abort
  50.                 Address CT_1 Quit
  51.                 exit
  52.                 end
  53.  
  54.             end
  55.         end
  56.     if OutFile.1 = "" then do
  57.         Address CT_1 OK_TEXT " OK "
  58.         Title = "You Must Enter A Valid Path For Stills!"
  59.         Address CT_1 FYINT Title
  60.         Address CT_1 Abort
  61.         Address CT_1 Quit
  62.         exit
  63.         end
  64.     call open TempFile,"RAM:CT-FTS",W
  65.     call writeln TempFile,Compression
  66.     call writeln TempFile,Type
  67.     do i = 1 to Times
  68.         call writeln TempFile,OutFile.i
  69.         end
  70.     if Type = 0 then do
  71.         do i = 1 to TotalNum
  72.             call writeln TempFile,StillName.i
  73.             end
  74.         end
  75.     call close TempFile
  76.     end
  77. else do
  78.     call open TempFile,"RAM:CT-FTS",R
  79.     line = readln(TempFile)
  80.     parse var line Compression
  81.     line = readln(TempFile)
  82.     parse var line Type
  83.     do i = 1 to Times
  84.         line = readln(TempFile)
  85.         parse var line OutFile.i
  86.         OutFile.i = strip(OutFile.i)
  87.         end
  88.     if Type = 0 then do
  89.         do i = 1 to TotalNum
  90.             line = readln(TempFile)
  91.             parse var line StillName.i
  92.             StillName.i = strip(StillName.i)
  93.             end
  94.         end
  95.     call close TempFile
  96.     end
  97.  
  98. InFile = strip(InFile)
  99. Select = strip(Select)
  100. if Times = 1 then Select = 1
  101.  
  102. TOASTERLIB="ToasterARexx.port"
  103. call remlib(TOASTERLIB)
  104. call remlib('PROJECT_REXX_PORT')
  105. call addlib('PROJECT_REXX_PORT' , 0)
  106. call addlib(TOASTERLIB,0)
  107.  
  108. call Routine
  109.  
  110. call remlib('PROJECT_REXX_PORT')
  111. call remlib('ToasterARexx.port')
  112. exit
  113.  
  114.  
  115.  
  116. YesOrNo: procedure
  117.     parse Arg Title,Yes,No
  118.     Address CT_1 OK_TEXT Yes
  119.     Address CT_1 CANCEL_TEXT No
  120.     Address CT_1 AskYesNoNT Title
  121.     if result = "OK" then YesNo = 1
  122.     else YesNo = 0
  123. return YesNo
  124.  
  125. GetFileName: procedure  
  126.    ARG CompleteName
  127.    c = lastpos("/",CompleteName)
  128.    if c = 0 then c = lastpos(":",CompleteName)
  129.    return substr(CompleteName, c + 1)
  130.  
  131.  
  132. GetPathName: procedure  
  133.    ARG CompleteName
  134.    c = lastpos(":",CompleteName)
  135.    if c = 0 then c = lastpos(":",CompleteName)
  136.    return left(CompleteName,c)
  137.  
  138.  
  139. GetPath:
  140.     parse Arg Title, Path
  141.     Address CT_1 SetString Path
  142.     Address CT_1 GetPathNameNT Title
  143. return result
  144.  
  145.  
  146. GetFile:
  147.     parse Arg Title, Path
  148.     Address CT_1 SetString Path
  149.     Address CT_1 GetFileNameNT Title
  150. return result
  151.  
  152.  
  153.  
  154. Routine:
  155.     call Switcher(MDV1)
  156.     call Switcher(PDV1)
  157.         call Switcher(LRGB,value("InFile"),0)
  158.  
  159.     Address CT_1 UpDate
  160.     if result = 0 then do
  161.         Address CT_1 Abort
  162.         Address CT_1 Quit
  163.         end
  164.     OutName = GetFileName(InFile)
  165.     NewName = OutFile.Select""OutName
  166.     i = FileNum
  167.     if Type = 0 then NewName = StillName.i
  168.         call RecordAdd(NewName,4,6,Compression)
  169.     Address CT_1 UpDate
  170.     if result = 0 then do
  171.         Address CT_1 Abort
  172.         Address CT_1 Quit
  173.         end
  174.     call MakeIcon(NewName,,'STILL')
  175.     Address CT_1 Quit
  176. return
  177.  
  178.  
  179. FindDrive:
  180.     address command "C:Info >RAM:CT-List"
  181.     call open TempFile,"RAM:CT-List",R
  182.     do until eof(TempFile)
  183.         line = readln(TempFile)
  184.         parse var line Drive" "Rest
  185.         if Drive = "FA0:" then 
  186.             Volume = word(Rest,7)":"
  187.     end
  188.     call close TempFile
  189. return Volume
  190.  
  191.  
  192. syntax:
  193. error:
  194.     Address CT_1 OK_TEXT " OK "
  195.     Title = "An Error Was Found With This Script On Line #"SIGL"!"
  196.     Address CT_1 FYI Title
  197.     Address CT_1 Abort
  198.     Address CT_1 Quit
  199. exit
  200.