home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDG-CT1.DMS / in.adf / CT.run / Scripts / 1 / Clips / Projects / BuildProject
Encoding:
Text File  |  1995-09-01  |  3.9 KB  |  175 lines

  1. /*
  2.                         Control Tower Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1995 Merlin's Software
  5. Lines=8
  6. 01=Build Project
  7. 02= 
  8. 03=This script takes the individual files
  9. 04=in your list and builds a flyer project
  10. 05=from them. It also has the option to add
  11. 06=your choice of transition in between the
  12. 07=files and checks to make sure the crouton
  13. 08=in front of it is of the correct type.
  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. TOASTERLIB="ToasterARexx.port"
  21. call remlib(TOASTERLIB)
  22. call remlib('PROJECT_REXX_PORT')
  23. call addlib('PROJECT_REXX_PORT' , 0)
  24. call addlib(TOASTERLIB,0)
  25.  
  26.  
  27. if Times > 1 then do
  28.     Address CT_1 OK_TEXT " OK "
  29.     Address CT_1 FYINT "This Routine Does Not Work\With Multiple Script Lists"
  30.     Address CT_1 Abort
  31.     Address CT_1 Quit
  32.     exit
  33.     end
  34. InFile = Translate(InFile," ","ยค")
  35.  
  36. if FileNum = 1 & WhichScript = 1 then do
  37.     call set_view(0)
  38.     Num = YesOrNo("Do You Want To Add To Existing Project Or Create New One?","ADD TO EXISTING","CREATE NEW")
  39.     if Num = 1 then do
  40.         Address CT_1 ClickMouse "110|069"
  41.         Address CT_1 ClickMouse "160|255"
  42.         Address CT_1 ClickMouse "105|255"
  43.         Address CT_1 ClickMouse "419|263"
  44.         Address CT_1 Update
  45.         end
  46.     OutFile = GetFile("Select Path & Name For Project!","Toaster:Projects")
  47.     Name = GetFileName(OutFile)
  48.     if Name = "" then do
  49.         Title = "You Must Enter A Valid Name For Frames!"
  50.         Address CT_1 OK_TEXT " OK "
  51.         Address CT_1 FYINT Title
  52.         Address CT_1 Abort
  53.         Address CT_1 Quit
  54.         exit
  55.         end
  56.     Fade = YesOrNo("Want To Add Transition Between Files?","PLEASE DO","NO THANKS")
  57.     if Fade = 2 then do
  58.         FadeFile = GetFile("Select Effect For Transition!","Toaster:Effects")
  59.         Name = GetFileName(FadeFile)
  60.         if Name = "" then do
  61.             Address CT_1 OK_TEXT " OK "
  62.             Title = "You Must Enter A Valid Name For Effect!"
  63.             Address CT_1 FYINT Title
  64.             Address CT_1 Abort
  65.             Address CT_1 Quit
  66.             exit
  67.             end
  68.         end
  69.     else FadeFile = ""
  70.     call open TempFile,"RAM:CT-MP",W
  71.     call writeln TempFile,OutFile
  72.     call writeln TempFile,Fade
  73.     call writeln TempFile,FadeFile
  74.     call close TempFile
  75.     end
  76. else do
  77.     call open TempFile,"RAM:CT-MP",R
  78.     line = readln(TempFile)
  79.     parse var line OutFile
  80.     line = readln(TempFile)
  81.     parse var line Fade
  82.     line = readln(TempFile)
  83.     parse var line FadeFile
  84.     call close TempFile
  85.     end
  86.  
  87. InFile = strip(InFile)
  88. OutFile = strip(OutFile)
  89.  
  90.  
  91. call Routine
  92.  
  93. call remlib('PROJECT_REXX_PORT')
  94. call remlib('ToasterARexx.port')
  95. exit
  96.  
  97.  
  98. GetFileName: procedure  
  99.    ARG CompleteName
  100.    c = lastpos("/",CompleteName)
  101.    if c = 0 then c = lastpos(":",CompleteName)
  102.    return substr(CompleteName, c + 1)
  103.  
  104.  
  105. GetPathName: procedure  
  106.    ARG CompleteName
  107.    c = lastpos(":",CompleteName)
  108.    if c = 0 then c = lastpos(":",CompleteName)
  109.    return left(CompleteName,c)
  110.  
  111. GetFile:
  112.     parse Arg Title, Path
  113.     Address CT_1 SetString Path
  114.     Address CT_1 GetFileNameNT Title
  115. return result
  116.  
  117.  
  118. YesOrNo: procedure
  119.     parse Arg Title,Yes,No
  120.     Address CT_1 OK_TEXT Yes
  121.     Address CT_1 CANCEL_TEXT No
  122.     Address CT_1 AskYesNoNT Title
  123.     if result = "OK" then YesNo = 2
  124.     else YesNo = 1
  125.     Address CT_1 OK_TEXT " OK "
  126. return YesNo
  127.  
  128. Routine:
  129.  
  130.         call CroutonLoad(InFile)
  131.     if Fade = 2 & FileNum ~= TotalNum then do
  132.         if CheckType() = 1 then do
  133.                 call CroutonLoad(FadeFile)
  134.             end
  135.         end
  136.     if FileNum = TotalNum then do
  137.         call ProjectSave(OutFile)
  138.         end
  139.     Address CT_1 Quit
  140. return
  141.  
  142.  
  143.  
  144. CheckType: procedure
  145.     call CroutonPick("LAST")
  146.     Num = CroutonSpot()-1
  147.     Add = 1
  148.     Row = 1
  149.     Column = 1
  150.     do Loop = 0 to Num
  151.         Add = Add + 1
  152.         if Add = 9 then do
  153.             Column = 0
  154.             Row = Row + 1
  155.             end
  156.         Column = Column + 1
  157.         end
  158.     call croutontype(Row,Column)
  159.     if result = "CLIP" | result = "STIL" | result = "FRAM" then Type = 1
  160.     else Type = 0
  161. return Type
  162.  
  163. syntax:
  164. error:
  165.     Address CT_1 OK_TEXT " OK "
  166.     Title = "An Error Was Found With This Script On Line #"SIGL"!"
  167.     if SIGL ~= 137 then do
  168.         Address CT_1 FYINT Title
  169.         Address CT_1 Abort
  170.         end
  171.     Address CT_1 Quit
  172.     call croutonpick()
  173. exit
  174.  
  175.