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 Frames
- 02=
- 03=This script will take Flyer Clips and will
- 04=load them into Toaster Paint then process
- 05=whatever options the user selects then save
- 06=the Frames out as FrameStores.
-
- */
-
- parse arg InFile FileNum TotalNum FrameRepeat WhichScript TotalScript Times Select
- signal on error
- signal on syntax
- options results
- InFile = Translate(InFile," ","ยค")
- DriveName = FindDrive()
- CR = '0A'x
-
- if FileNum = 1 then do
- Address "DigiPaint"
- Address command "C:Wait 2"
- Address CT_1 ScreenToFront
- Address CT_1 SetString "CT:Scripts2/2/"
- Address CT_1 GetMultiName "Select Options (Hold Shift Key Down For Multiple Process!) "
- do i = 1 to TotalNum
- Address CT_1 GetScriptFileName i-1
- FileName = result
- blank = "Select Path & BaseName For Frames From "FileName"!"
- OutFile.i = GetFile(blank,"RAM:")
- end
- Name = GetFileName(OutFile.1)
- if Name = "" then do
- Address CT_1 OK_TEXT " OK "
- Title = "You Must Enter A Valid Name For Frames!"
- Address CT_1 FYI Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
- end
-
- do i = 1 to TotalNum
- Address CT_1 GetScriptFileName i-1
- FileName = result
- Address CT_1 GetClipLength FileName
- End = result+1
-
- Address CT_1 ConvertNum End
- TimeCode = result
- Address CT_1 OK_TEXT " OK "
- NewCode = GetTextTC("Enter Starting Time Code For\"center(FileName,28," ")"\ 00:00:00:00 to "TimeCode"","00:00:00:00")
- Address CT_1 ConvertTC NewCode
- Start.i = result
-
- Address CT_1 OK_TEXT " OK "
- NewCode = GetTextTC("Enter Ending Time Code For\"center(FileName,26," ")"\00:00:00:00 to "TimeCode"",TimeCode)
- Address CT_1 ConvertTC NewCode
- End.i = result
- end
-
- Address CT_1 OpenMessage "Hit ^C To Abort Process!"
- address command "C:Wait 3"
- Address CT_1 CloseMessage
- call open TempFile,"RAM:CT-TP",W
- do i = 1 to TotalNum
- call writeln TempFile,OutFile.i
- call writeln TempFile,Start.i
- call writeln TempFile,End.i
- end
- call close TempFile
- end
- else do
- call open TempFile,"RAM:CT-TP",R
- do i = 1 to TotalNum
- line = readln(TempFile)
- parse var line OutFile.i
- OutFile.i = strip(OutFile.i)
- line = readln(TempFile)
- parse var line OutFile.i
- Start.i = strip(OutFile.i)
- line = readln(TempFile)
- parse var line OutFile.i
- End.i = strip(OutFile.i)
- end
- call close TempFile
- end
-
- InFile = strip(InFile)
-
- call Routine
-
- exit
-
-
- GetTextTC:
- parse Arg Title, Text
- Address CT_1 SetString Text
- Address CT_1 GetStringTC Title
- return result
-
- GetFileName: procedure
- parse ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return substr(CompleteName, c + 1)
-
-
- GetPathName: procedure
- parse ARG CompleteName
- c = lastpos(":",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return left(CompleteName,c)
-
- GetFile:
- parse Arg Title, Path
- Address CT_1 SetString Path
- Address CT_1 GetFileName Title
- return result
-
-
- YesOrNo: procedure
- parse Arg Title,Yes,No
- Address CT_1 OK_TEXT Yes
- Address CT_1 CANCEL_TEXT No
- Address CT_1 AskYesNo Title
- if result = "OK" then YesNo = 2
- else YesNo = 1
- return YesNo
-
-
- SavePic: procedure
- parse arg file
- 'Saco'
- 'Frbx'
- dirname=GetPathName(file)
- 'Dnam'dirname
- 'Dsel'
- filename=GetFileName(file)
- 'Fnam'filename
- 'Okls'
- return
-
-
- LoadClip: procedure
- arg file
- 'Proc'
- 'Slcp'
- dirname=GetPathName(file)
- 'Dnam'dirname
- filename=GetFileName(file)
- 'Fnam'filename
- 'Okls'
- return
-
- Routine:
- Address "DigiPaint"
- call LoadClip(InFile)
- Start = Start.FileNum
- End = End.FileNum
- if ~open('Window','RAW:'0'/'0'/'640'/'150'/Control Tower - Hit Control-C to Abort/NOSIZE/SCREEN','W') then do
- address CT_1 Abort
- address CT_1 Quit
- exit
- end
- if Start ~= 0 then do
- 'Snfd'
- do i = 1 to Start-1
- 'Snfd'
- 'Snfd'
- end
- end
- ii = 0
- do i = Start to End
- call writech('Window',"Processing Frame #"i""CR)
- 'Gnfm'
- call SubRoutine(FileNum,TotalNum)
- ii = ii +1
- SaveName = OutFile.FileNum""right(ii,3,'0')
- if ii > 999 then
- SaveName = OutFile.FileNum""right(ii,4,'0')
- if ii > 9999 then
- SaveName = OutFile.FileNum""right(ii,5,'0')
- call SavePic(SaveName)
- end
- Address CT_1 Quit
-
- return
-
- FindDrive:
- address command "C:Info >RAM:CT-List"
- call open TempFile,"RAM:CT-List",R
- do until eof(TempFile)
- line = readln(TempFile)
- parse var line Drive" "Rest
- if Drive = "FA0:" then
- Volume = word(Rest,7)":"
- end
- call close TempFile
- return Volume
-
-
- SubRoutine:
- parse Arg Num,TotalNum
- call open TempFile,"Ram:CT-LIST",R
- do until eof(TempFile)
- DoIt = readln(TempFile)
- if DoIt ~= "" then
- address command "SYS:rexxc/rx >NIL: "DoIt" "Num" "TotalNum
- end
- call close TempFile
- return
-
-
- syntax:
- error:
- Address CT_1 OK_TEXT " OK "
- Title = "An Error Was Found With This Script On Line #"SIGL"!"
- if SIGL ~= 177 & SIGL ~= 93 then
- Address CT_1 FYI Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
-
-