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

  1. /*
  2.                         Control Tower Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1995 Merlin's Software
  5. Lines=12
  6. 01=Frames To Clip
  7. 02= 
  8. 03=This script will take individual frames
  9. 04=and build a flyer clip from them. The 
  10. 05=frame repeat option in Control Tower 
  11. 06=allows you to easily set the beginning
  12. 07=and end frame for longer than one to 
  13. 08=create transition time at the beginning
  14. 09=and end of each clip. You can set each
  15. 10=frame with different frame repeats for
  16. 11=effects such as pausing on a particular
  17. 12=frame or range of frames, etc.
  18.  
  19. */
  20.  
  21. parse arg InFile FileNum TotalNum FrameRepeat WhichScript TotalScript Times Select
  22. signal on error
  23. signal on syntax
  24. options results
  25. InFile = Translate(InFile," ","ยค")
  26. DriveName = FindDrive()
  27. if FileNum = 1 & WhichScript = 1 then do
  28.     Address CT_1 GetCompressionNT
  29.     Compression = result
  30.     FrameField = YesOrNo("Select Frame Or Field Format?"," FRAME "," FIELD ")
  31.     do i = 1 to Times
  32.         blank = "Select Path & Name For Clip #"i"!"
  33.         OutFile.i = GetFile(blank,DriveName)
  34.         DriveName = GetPathName(OutFile.i)
  35.         end
  36.     Name = GetFileName(OutFile.1)
  37.     if Name = "" then do
  38.         Address CT_1 OK_TEXT " OK "
  39.         Title = "You Must Enter A Valid Name For Clip!"
  40.         Address CT_1 FYINT Title
  41.         Address CT_1 Abort
  42.         Address CT_1 Quit
  43.         exit
  44.         end
  45.     call open TempFile,"RAM:CT-FTC",W
  46.     call writeln TempFile,FrameField
  47.     call writeln TempFile,Compression
  48.     do i = 1 to Times
  49.         call writeln TempFile,OutFile.i
  50.         end
  51.     call close TempFile
  52.     end
  53. else do
  54.     call open TempFile,"RAM:CT-FTC",R
  55.     line = readln(TempFile)
  56.     parse var line FrameField
  57.     line = readln(TempFile)
  58.     parse var line Compression
  59.     do i = 1 to Times
  60.         line = readln(TempFile)
  61.         parse var line OutFile.i
  62.         OutFile.i = strip(OutFile.i)
  63.         end
  64.     call close TempFile
  65.     end
  66.  
  67. InFile = strip(InFile)
  68. Select = strip(Select)
  69. if Times = 1 then Select = 1
  70. TOASTERLIB="ToasterARexx.port"
  71. call remlib(TOASTERLIB)
  72. call remlib('PROJECT_REXX_PORT')
  73. call addlib('PROJECT_REXX_PORT' , 0)
  74. call addlib(TOASTERLIB,0)
  75.  
  76. call Routine
  77.  
  78. call remlib('PROJECT_REXX_PORT')
  79. call remlib('ToasterARexx.port')
  80. exit
  81.  
  82.  
  83. GetFileName: procedure  
  84.    ARG CompleteName
  85.    c = lastpos("/",CompleteName)
  86.    if c = 0 then c = lastpos(":",CompleteName)
  87.    return substr(CompleteName, c + 1)
  88.  
  89.  
  90. GetPathName: procedure  
  91.    ARG CompleteName
  92.    c = lastpos(":",CompleteName)
  93.    if c = 0 then c = lastpos(":",CompleteName)
  94.    return left(CompleteName,c)
  95.  
  96. GetFile:
  97.     parse Arg Title, Path
  98.     Address CT_1 SetString Path
  99.     Address CT_1 GetFileNameNT Title
  100. return result
  101.  
  102.  
  103. YesOrNo: procedure
  104.     parse Arg Title,Yes,No
  105.     Address CT_1 OK_TEXT Yes
  106.     Address CT_1 CANCEL_TEXT No
  107.     Address CT_1 AskYesNoNT Title
  108.     if result = "OK" then YesNo = 2
  109.     else YesNo = 1
  110. return YesNo
  111.  
  112. Routine:
  113.     call Switcher(MDV1)
  114.     call Switcher(PDV1)
  115.         call Switcher(LRGB,value("InFile"),0)
  116.  
  117.     Address CT_1 UpDate
  118.     if result = 0 then do
  119.         Address CT_1 Abort
  120.         Address CT_1 Quit
  121.         end
  122.         call RecordAdd(OutFile.Select,FrameRepeat*FrameField,6,Compression)
  123.     Address CT_1 UpDate
  124.     if result = 0 then do
  125.         Address CT_1 Abort
  126.         Address CT_1 Quit
  127.         end
  128.     if FileNum = TotalNum then do
  129.         do i = 1 to Times
  130.             call MakeIcon(OutFile.i)
  131.             end
  132.         end
  133.     Address CT_1 Quit
  134. return
  135.  
  136. FindDrive:
  137.     address command "C:Info >RAM:CT-List"
  138.     call open TempFile,"RAM:CT-List",R
  139.     do until eof(TempFile)
  140.         line = readln(TempFile)
  141.         parse var line Drive" "Rest
  142.         if Drive = "FA0:" then 
  143.             Volume = word(Rest,7)":"
  144.     end
  145.     call close TempFile
  146. return Volume
  147.  
  148. syntax:
  149. error:
  150.     Address CT_1 OK_TEXT " OK "
  151.     Title = "An Error Was Found With This Script On Line #"SIGL"!"
  152.     Address CT_1 FYINT Title
  153.     Address CT_1 Abort
  154.     Address CT_1 Quit
  155. exit
  156.  
  157.