home *** CD-ROM | disk | FTP | other *** search
- /*
- Control Tower Arexx Script
- Written By J.L. White
- (C)1995 Merlin's Software
- Lines=8
- 01=Frames To Stills
- 02=
- 03=This script takes frames and creates
- 04=flyer stills from each. This makes it
- 05=very easy to take Framestores or RGB
- 06=files and convert them into stills
- 07=which take up less space on your Hard
- 08=Drive and load much faster.
- */
-
-
- parse arg InFile FileNum TotalNum FrameRepeat WhichScript TotalScript Times Select
- signal on error
- signal on syntax
- options results
- InFile = Translate(InFile," ","ยค")
- DriveName = FindDrive()
-
- if FileNum = 1 & WhichScript = 1 then do
- Address CT_1 GetCompressionNT
- Compression = result
- Type = YesOrNo("Use FileNames Or Select New Names For Stills?"," FILENAME "," NEW NAME ")
- if Type = 1 then do
- do i = 1 to Times
- blank = "Select Path For Stills Collection #"i"!"
- OutFile.i = GetPath(blank,DriveName)
- DriveName = GetPathName(OutFile.i)
- end
- end
- else do
- OutFile.1 = "NewName"
- do i = 1 to TotalNum
- x = i-1
- Address CT_1 GetScriptFileName x
- Name = result
- NewName = GetFileName(Name)
- blank = "Enter New Name For "NewName"!"
- StillName.i = GetFile(blank,DriveName)
- NewName = GetFileName(StillName.i)
- if NewName = "" then do
- Address CT_1 OK_TEXT " OK "
- Title = "You Must Enter A Valid Path & Name For Stills!"
- Address CT_1 FYINT Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
- end
-
- end
- end
- if OutFile.1 = "" then do
- Address CT_1 OK_TEXT " OK "
- Title = "You Must Enter A Valid Path For Stills!"
- Address CT_1 FYINT Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
- end
- call open TempFile,"RAM:CT-FTS",W
- call writeln TempFile,Compression
- call writeln TempFile,Type
- do i = 1 to Times
- call writeln TempFile,OutFile.i
- end
- if Type = 0 then do
- do i = 1 to TotalNum
- call writeln TempFile,StillName.i
- end
- end
- call close TempFile
- end
- else do
- call open TempFile,"RAM:CT-FTS",R
- line = readln(TempFile)
- parse var line Compression
- line = readln(TempFile)
- parse var line Type
- do i = 1 to Times
- line = readln(TempFile)
- parse var line OutFile.i
- OutFile.i = strip(OutFile.i)
- end
- if Type = 0 then do
- do i = 1 to TotalNum
- line = readln(TempFile)
- parse var line StillName.i
- StillName.i = strip(StillName.i)
- end
- end
- call close TempFile
- end
-
- InFile = strip(InFile)
- Select = strip(Select)
- if Times = 1 then Select = 1
-
- TOASTERLIB="ToasterARexx.port"
- call remlib(TOASTERLIB)
- call remlib('PROJECT_REXX_PORT')
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
-
- call Routine
-
- call remlib('PROJECT_REXX_PORT')
- call remlib('ToasterARexx.port')
- exit
-
-
-
- YesOrNo: procedure
- parse Arg Title,Yes,No
- Address CT_1 OK_TEXT Yes
- Address CT_1 CANCEL_TEXT No
- Address CT_1 AskYesNoNT Title
- if result = "OK" then YesNo = 1
- else YesNo = 0
- return YesNo
-
- 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 GetPathNameNT Title
- return result
-
-
- GetFile:
- parse Arg Title, Path
- Address CT_1 SetString Path
- Address CT_1 GetFileNameNT Title
- return result
-
-
-
- Routine:
- call Switcher(MDV1)
- call Switcher(PDV1)
- call Switcher(LRGB,value("InFile"),0)
-
- Address CT_1 UpDate
- if result = 0 then do
- Address CT_1 Abort
- Address CT_1 Quit
- end
- OutName = GetFileName(InFile)
- NewName = OutFile.Select""OutName
- i = FileNum
- if Type = 0 then NewName = StillName.i
- call RecordAdd(NewName,4,6,Compression)
- Address CT_1 UpDate
- if result = 0 then do
- Address CT_1 Abort
- Address CT_1 Quit
- end
- call MakeIcon(NewName,,'STILL')
- 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
-
-
- syntax:
- error:
- Address CT_1 OK_TEXT " OK "
- Title = "An Error Was Found With This Script On Line #"SIGL"!"
- Address CT_1 FYI Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
-