home *** CD-ROM | disk | FTP | other *** search
- /*
- Control Tower Arexx Script
- Written By J.L. White
- (C)1995 Merlin's Software
- Lines=14
- 01=Import To Clip
- 02=
- 03=This script will take individual frames
- 04=in ANY format that is supported by the
- 05=flyer hiip routines then process each
- 06=and build a flyer clip from them. The
- 07=frame repeat option in Control Tower
- 08=allows you to easily set the beginning
- 09=and end frame for longer than one to
- 10=create transition time at the beginning
- 11=and end of each clip. You can set each
- 12=frame with different frame repeats for
- 13=effects such as pausing on a particular
- 14=frame or range of frames, etc.
-
- */
-
- parse arg InFile FileNum TotalNum FrameRepeat WhichScript TotalScript Times Select
- signal on error
- signal on syntax
- options results
-
- InFile = Translate(InFile," ","ยค")
- DriveName = FindDrive()
- TempDir = FindTemp()
- TempDirFile = TempDir"CT-Temp"
-
- if FileNum = 1 & WhichScript = 1 then do
- Address CT_1 GetCompressionNT
- Compression = result
- address command "C:Assign HIIP: Toaster:Programs/hiip_support"
- FrameField = YesOrNo("Select Frame Or Field Format?"," FRAME "," FIELD ")
- do i = 1 to Times
- blank = "Select Path & Name For Clip #"i"!"
- OutFile.i = GetFile(blank,DriveName)
- DriveName = GetPathName(OutFile.i)
- end
- Name = GetFileName(OutFile.1)
- if Name = "" then do
- Address CT_1 OK_TEXT " OK "
- Title = "You Must Enter A Valid Name For Clip!"
- Address CT_1 FYINT Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
- end
- call open TempFile,"RAM:CT-ITC",W
- call writeln TempFile,FrameField
- call writeln TempFile,Compression
- do i = 1 to Times
- call writeln TempFile,OutFile.i
- end
- call close TempFile
- end
- else do
- call open TempFile,"RAM:CT-ITC",R
- line = readln(TempFile)
- parse var line FrameField
- line = readln(TempFile)
- parse var line Compression
- do i = 1 to Times
- line = readln(TempFile)
- parse var line OutFile.i
- OutFile.i = strip(OutFile.i)
- 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
-
-
- 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)
-
- GetFile:
- parse Arg Title, Path
- Address CT_1 SetString Path
- Address CT_1 GetFileNameNT 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 AskYesNoNT Title
- if result = "OK" then YesNo = 2
- else YesNo = 1
- return YesNo
-
- Routine:
- call Switcher(MDV1)
- call Switcher(PDV1)
-
- TempName = TempDirFile
- Address CT_1 OpenMessageNT "Gnusto Program Is Now Converting File!"
- Address command "C:gnusto >NIL: "InFile" "TempName" image saver iff sy "value(0)" sx "value(752)" sn bestup"
- Address CT_1 CloseMessageNT
- call Switcher(LRGB,value("TempName"),0)
- Address CT_1 UpDate
- if result = 0 then do
- Address CT_1 Abort
- Address CT_1 Quit
- end
- Address command "Delete >NIL: "TempDirFile
-
- call RecordAdd(OutFile.Select,FrameRepeat*FrameField,6,Compression)
- Address CT_1 UpDate
- if result = 0 then do
- Address CT_1 Abort
- Address CT_1 Quit
- end
- if FileNum = TotalNum then do
- do i = 1 to Times
- call MakeIcon(OutFile.i)
- end
- address command "Delete >NIL: RAM:CT-ITC"
- 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
-
- FindTemp:
- call open TempFile,"RAM:CT-Dir",R
- TempPath = readln(TempFile)
- call close TempFile
- return TempPath
-
- 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
-
-