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

  1. /*
  2.                         Control Tower Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1995 Merlin's Software
  5. Lines=7
  6. 01=Clip To RGB
  7. 02= 
  8. 03=This script will take Flyer Clips and
  9. 04=split them into individual RGB images.
  10. 05=Each Frame Will Have Motion Removal ON.
  11. 06=You can select which frames to pull and
  12. 07=also do more than one clip in the process.
  13.  
  14. */
  15.  
  16. parse arg InFile FileNum TotalNum FrameRepeat WhichScript TotalScript Times Select
  17. signal on error
  18. signal on syntax
  19. options results
  20.  
  21. InFile = Translate(InFile," ","ยค")
  22. InFile = strip(InFile)
  23. DriveName = "RAM:"
  24. TempDir = FindTemp()
  25. TempDirFile = TempDir"CT-Temp"
  26. if FileNum = 1 & WhichScript = 1 then do
  27.     address command "C:Assign HIIP: Toaster:Programs/hiip_support"
  28.     do i = 1 to TotalNum
  29.         blank = "Select Path & BaseName For Frames From Clip #"i"!    "
  30.         OutPath.i = GetPath(blank,DriveName)
  31.         DriveName = GetPathName(OutPath.i)
  32.         Name = GetFileName(OutPath.i)
  33.         if Name = "" then do
  34.             Address CT_1 OK_TEXT " OK "
  35.             Title = "You Must Enter A Valid Name For Frames!"
  36.             Address CT_1 FYINT Title
  37.             Address CT_1 Abort
  38.             Address CT_1 Quit
  39.             exit
  40.             end
  41.         Address CT_1 GetScriptFileName i-1
  42.         FileName = result
  43.         Address CT_1 GetClipLength FileName
  44.         End = result
  45.         Address CT_1 StartNum "0"
  46.         Address CT_1 EndNum End
  47.         Address CT_1 CurrentNum "0"
  48.         Address CT_1 GetTimeNT "Select A Range Of Frames To Process!"
  49.         Start.i = word(result,1)
  50.         End.i = word(result,2)
  51.         end
  52.     if OutPath.1 = "" then do
  53.         Address CT_1 OK_TEXT " OK "
  54.         Title = "You Must Enter A Valid Path For Frames!"
  55.         Address CT_1 FYINT Title
  56.         Address CT_1 Abort
  57.         Address CT_1 Quit
  58.         exit
  59.         end
  60.     call open TempFile,"RAM:CT-CTFS",W
  61.     do i = 1 to TotalNum
  62.         call writeln TempFile,OutPath.i
  63.         call writeln TempFile,Start.i
  64.         call writeln TempFile,End.i
  65.         end
  66.     call close TempFile
  67.     end
  68. else do
  69.     call open TempFile,"RAM:CT-CTFS",R
  70.     do i = 1 to TotalNum
  71.         line = readln(TempFile)
  72.         parse var line OutPath.i
  73.         OutPath.i = strip(OutPath.i)
  74.         line = readln(TempFile)
  75.         parse var line Start.i
  76.         line = readln(TempFile)
  77.         parse var line End.i
  78.         end
  79.     call close TempFile
  80.     end
  81.  
  82. call Routine
  83.  
  84. exit
  85.  
  86.  
  87.  
  88. GetPathName: procedure  
  89.    ARG CompleteName
  90.    c = lastpos("/",CompleteName)
  91.    if c = 0 then c = lastpos(":",CompleteName)
  92.    return left(CompleteName,c)
  93.  
  94. GetFileName: procedure  
  95.    ARG CompleteName
  96.    c = lastpos("/",CompleteName)
  97.    if c = 0 then c = lastpos(":",CompleteName)
  98.    return substr(CompleteName, c + 1)
  99.  
  100.  
  101. GetPath:
  102.     parse Arg Title, Path
  103.     Address CT_1 SetString Path
  104.     Address CT_1 GetFileNameNT Title
  105. return result
  106.  
  107.  
  108.  
  109. Routine:
  110.     TOASTERLIB="ToasterARexx.port"
  111.     call remlib(TOASTERLIB)
  112.     call remlib('PROJECT_REXX_PORT')
  113.     call addlib('PROJECT_REXX_PORT' , 0)
  114.     call addlib(TOASTERLIB,0)
  115.     if FileNum = 1 then
  116.         call Set_View(2)
  117.     call Switcher(M003)
  118.     call Switcher(P003)
  119.     Address CT_1 StartNum Start.FileNum
  120.     Address CT_1 EndNum End.FileNum
  121.     do i = Start.FileNum to End.FileNum
  122.         OutName = GetFileName(InFile)
  123.         NewName = OutPath.FileNum""right(i,3,"0")
  124.         if i > 999 then
  125.             NewName = OutPath.FileNum""right(i,4,"0")
  126.         if i > 9999 then
  127.             NewName = OutPath.FileNum""right(i,5,"0")
  128.         call Switcher(M003)
  129.         call Switcher(LVID)
  130.         Address command "toaster:programs/flyer_support/c/playclip 0 0 0 "InFile" "d2x(i)" 1 0 1 0"
  131.         call Switcher(FVID)
  132.         call Switcher(MDV1)
  133.  
  134.         Address CT_1 UpDate_Loop i
  135.         if result = 0 then do
  136.             Address CT_1 Abort
  137.             Address CT_1 Quit
  138.             end
  139.         address command "C:wait 2"
  140.         call Switcher(SRGB,NewName,0,4)
  141.         Address CT_1 UpDate_Loop i
  142.         if result = 0 then do
  143.             Address CT_1 Abort
  144.             Address CT_1 Quit
  145.             end
  146.     end
  147.     Address CT_1 UpDate
  148.     if result = 0 then do
  149.         Address CT_1 Abort
  150.         Address CT_1 Quit
  151.         end
  152.     if FileNum = TotalNum then do
  153.         address command "Delete >NIL: RAM:CT-CTFS"
  154.         end
  155.     if FileNum = TotalNum then
  156.         call Set_View(0)
  157.     Address CT_1 Quit
  158. return
  159.  
  160.  
  161. FindTemp:
  162.     call open TempFile,"RAM:CT-Dir",R
  163.     TempPath = readln(TempFile)
  164.     call close TempFile
  165. return TempPath
  166.  
  167. syntax:
  168. error:
  169.     Address CT_1 OK_TEXT " OK "
  170.     Title = "An Error Was Found With This Script On Line #"SIGL"!"
  171.     Address CT_1 CloseMessageNT
  172.     Address CT_1 FYINT Title
  173.     Address CT_1 Abort
  174.     Address CT_1 Quit
  175. exit
  176.  
  177.