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

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