home *** CD-ROM | disk | FTP | other *** search
- /*
- Control Tower Arexx Script
- Written By J.L. White
- (C)1995 Merlin's Software
- Lines=6
- 01=Clip To FS
- 02=
- 03=This script will take Flyer Clips and
- 04=split them into individual Framestores.
- 05=You can select which frames to pull and
- 06=also do more than one clip in the process.
-
- */
-
- parse arg InFile FileNum TotalNum FrameRepeat WhichScript TotalScript Times Select
- signal on error
- signal on syntax
- options results
-
- InFile = Translate(InFile," ","ยค")
- InFile = strip(InFile)
- DriveName = "RAM:"
- if FileNum = 1 & WhichScript = 1 then do
- address command "C:Assign HIIP: Toaster:Programs/hiip_support"
- do i = 1 to TotalNum
- blank = "Select Path & BaseName For Frames From Clip #"i"! "
- OutPath.i = GetPath(blank,DriveName)
- DriveName = GetPathName(OutPath.i)
- Name = GetFileName(OutPath.i)
- if Name = "" then do
- Address CT_1 OK_TEXT " OK "
- Title = "You Must Enter A Valid Name For Frames!"
- Address CT_1 FYINT Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
- end
- Address CT_1 GetScriptFileName i-1
- FileName = result
- Address CT_1 GetClipLength FileName
- End = result
- Address CT_1 StartNum "0"
- Address CT_1 EndNum End
- Address CT_1 CurrentNum "0"
- Address CT_1 GetTimeNT "Select A Range Of Frames To Process!"
- Start.i = word(result,1)
- End.i = word(result,2)
- end
- if OutPath.1 = "" then do
- Address CT_1 OK_TEXT " OK "
- Title = "You Must Enter A Valid Path For Frames!"
- Address CT_1 FYINT Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
- end
- call open TempFile,"RAM:CT-CTFS",W
- do i = 1 to TotalNum
- call writeln TempFile,OutPath.i
- call writeln TempFile,Start.i
- call writeln TempFile,End.i
- end
- call close TempFile
- end
- else do
- call open TempFile,"RAM:CT-CTFS",R
- do i = 1 to TotalNum
- line = readln(TempFile)
- parse var line OutPath.i
- OutPath.i = strip(OutPath.i)
- line = readln(TempFile)
- parse var line Start.i
- line = readln(TempFile)
- parse var line End.i
- end
- call close TempFile
- end
-
- call Routine
-
- exit
-
-
-
- GetFileName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return substr(CompleteName, c + 1)
-
- GetPathName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return left(CompleteName,c)
-
-
- GetPath:
- parse Arg Title, Path
- Address CT_1 SetString Path
- Address CT_1 GetFileNameNT Title
- return result
-
-
-
- Routine:
- TOASTERLIB="ToasterARexx.port"
- call remlib(TOASTERLIB)
- call remlib('PROJECT_REXX_PORT')
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
- if FileNum = 1 then
- call Set_View(2)
- call Switcher(M003)
- call Switcher(P003)
- Address CT_1 StartNum Start.FileNum
- Address CT_1 EndNum End.FileNum
- do i = Start.FileNum to End.FileNum
- OutName = GetFileName(InFile)
- NewName = OutPath.FileNum""right(i,3,"0")
- if i > 999 then
- NewName = OutPath.FileNum""right(i,4,"0")
- if i > 9999 then
- NewName = OutPath.FileNum""right(i,5,"0")
- call Switcher(M003)
- Address command "toaster:programs/flyer_support/c/playclip 0 0 0 "InFile" "d2x(i)" 1 0 1 0"
- Address command "C:Wait 1"
- Address CT_1 ClickMouse "639|329"
- call Switcher(MDV1)
-
- Address CT_1 UpDate_Loop i
- if result = 0 then do
- Address CT_1 Abort
- Address CT_1 Quit
- end
- address command "C:wait 2"
- call Switcher(FMSV,NewName,4)
- Address CT_1 UpDate_Loop i
- if result = 0 then do
- Address CT_1 Abort
- Address CT_1 Quit
- end
- end
- Address CT_1 UpDate
- if result = 0 then do
- Address CT_1 Abort
- Address CT_1 Quit
- end
- if FileNum = TotalNum then
- call Set_View(0)
- Address CT_1 Quit
- return
-
-
- syntax:
- error:
- Address CT_1 OK_TEXT " OK "
- Title = "An Error Was Found With This Script On Line #"SIGL"!"
- Address CT_1 CloseMessageNT
- Address CT_1 FYINT Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
-
-