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

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