home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDG-CT1.DMS / in.adf / CT.run / Macros / Change_STILL_Length.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-10-09  |  2.9 KB  |  142 lines

  1. /*
  2.                         Control Tower Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1995 Merlin's Software
  5. */
  6.  
  7. signal on error
  8. signal on syntax
  9. Options Results
  10.  
  11. Main:
  12. call OpenStuff()
  13. call Docs()
  14. call Routine()
  15. call CloseStuff()
  16. exit
  17. return
  18.  
  19. GetFile:
  20.     parse Arg Title, Path
  21.     Address FLY_1 SetString Path
  22.     Address FLY_1 GetFileNameNT Title
  23. return result
  24.  
  25.  
  26. GetPath:
  27.     parse Arg Title, Path
  28.     Address FLY_1 SetString Path
  29.     Address FLY_1 GetPathNameNT Title
  30. return result
  31.  
  32. GetTextTC:
  33.     parse Arg Title, Text
  34.     Address FLY_1 SetString Text
  35.     Address FLY_1 GetStringNTTC Title
  36. return result
  37.  
  38.  
  39. OpenStuff:
  40.     address command "run CT:FLY"
  41.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  42.         address command "wait 1"
  43.         end
  44.     TOASTERLIB="ToasterARexx.port"
  45.     call remlib('ToasterARexx.port')
  46.     call remlib('PROJECT_REXX_PORT')
  47.     call addlib('PROJECT_REXX_PORT' , 0)
  48.     call addlib(TOASTERLIB,0)
  49. return
  50.  
  51. CloseStuff:
  52.     Address FLY_1 Quit
  53.     call remlib('ToasterARexx.port')
  54.     call remlib('PROJECT_REXX_PORT')
  55.     exit
  56. return
  57.  
  58. YesOrNo: procedure
  59.     parse Arg Title,Yes,No
  60.     Address FLY_1 OK_TEXT Yes
  61.     Address FLY_1 CANCEL_TEXT No
  62.     Address FLY_1 AskYesNoNT Title
  63.     if result = "OK" then YesNo = 1
  64.     else YesNo = 0
  65. return YesNo
  66.  
  67. Info: 
  68.     parse Arg Title,Yes
  69.     Address FLY_1 OK_TEXT Yes
  70.     Address FLY_1 FYINT Title
  71. return
  72.  
  73. FindDrive:
  74.     address command "C:Info >RAM:FLY-List"
  75.     call open TempFile,"RAM:FLY-List",R
  76.     do until eof(TempFile)
  77.         line = readln(TempFile)
  78.         parse var line Drive" "Rest
  79.         if Drive = "FA0:" then 
  80.             Volume = word(Rest,7)":"
  81.     end
  82.     call close TempFile
  83.     address command "Delete >NIL: RAM:FLY-List"
  84. return Volume
  85.  
  86. GetFileName: procedure  
  87.    ARG CompleteName
  88.    c = lastpos("/",CompleteName)
  89.    if c = 0 then c = lastpos(":",CompleteName)
  90.    return substr(CompleteName, c + 1)
  91.  
  92.  
  93. GetPathName: procedure  
  94.    ARG CompleteName
  95.    c = lastpos(":",CompleteName)
  96.    if c = 0 then c = lastpos(":",CompleteName)
  97.    return left(CompleteName,c)
  98.  
  99. Docs:
  100. Answer = YesOrNo(" Do You Need Instructions?"," YES "," NO ")
  101. if Answer = 0 then return 
  102. Text = "This Macro will adjust the length of ALL\
  103. Flyer Stills in the current Project to a\
  104. new user selected length!"
  105. Answer = YesOrNo(Text," Continue "," Exit ")
  106. if Answer = 0 then call CloseStuff()
  107.  
  108. return
  109.  
  110.  
  111. Routine:
  112.     Address FLY_1 OK_TEXT " OK "
  113.     TimeCode = GetTextTC("Enter New STILL Length","00:00:00:00")
  114.     Address FLY_1 ConvertTC TimeCode
  115.     Num = result*2
  116.  
  117.     start_loc=croutonspot()
  118.     call croutonpick(LAST)
  119.     project_end=croutonspot()
  120.     call croutonpick(FIRST)
  121.     current_spot=0
  122.     do while (current_spot<project_end+1)
  123.            call croutonpick(current_spot)
  124.            current_spot=current_spot+1
  125.            if croutontype()="STIL" then do
  126.                   call croutonsettag(Duration,Num)
  127.                   end
  128.            end
  129.     call croutonpick(start_loc)
  130.  
  131.     Address FLY_1 FYINT "STILL Lengths Have ALL Been Changed!"
  132. return
  133.  
  134.  
  135. syntax:
  136. error:
  137.     Address FLY_1 OK_TEXT " OK "
  138.     Title = "An Error Was Found With This Macro On Line #"SIGL"!"
  139.     Address FLY_1 FYINT Title
  140.     Address FLY_1 Quit
  141. exit
  142.