home *** CD-ROM | disk | FTP | other *** search
- /*
- Control Tower Arexx Script
- Written By J.L. White
- (C)1995 Merlin's Software
- Lines=7
- 01=Import
- 02=
- 03=This script will take individual frames
- 04=in ANY format that is supported by the
- 05=flyer hiip routines and load them into
- 06=Toaster Paint then process whatever the
- 07=user selects then save them as a Clip.
-
- */
-
- 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 WhichScript ~= 1 then do
- Address CT_1 ScreenToFront
- Address CT_1 OK_TEXT " OK "
- Title = "Import Can ONLY Used As The First Process In The List!"
- Address CT_1 FYI Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
- end
- if FileNum = 1 & WhichScript = 1 then do
- Address command "C:Assign HIIP: Toaster:Programs/hiip_support"
- Address "DigiPaint"
- Address command "C:Wait 2"
- Address CT_1 ScreenToFront
- FrameField = YesOrNo("Select Frame Or Field Format?"," FRAME "," FIELD ")
- Address CT_1 SetString "CT:Scripts2/2/"
- Address CT_1 GetMultiName "Select Options (Hold Shift Key Down For Multiple Process!) "
- do i = 1 to Times
- blank = "Select Path & Name For Clip #"i"!"
- OutFile.i = GetFile(blank,DriveName)
- 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 FYI Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
- end
- call open TempFile,"RAM:CT-TP",W
- call writeln TempFile,FrameField
- do i = 1 to Times
- call writeln TempFile,OutFile.i
- end
- call close TempFile
- end
- else do
- call open TempFile,"RAM:CT-TP",R
- line = readln(TempFile)
- parse var line FrameField
- 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
-
- 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)
-
- 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
-
-
- SaveClip: procedure
- arg file
- 'Sacp'
- dirname=GetPathName(file)
- 'Dnam'dirname
- filename=GetFileName(file)
- 'Fnam'filename
- 'Okls'
- return
-
- Routine:
- Address "DigiPaint"
- if Select = 1 then do
- call open TempFile,"RAM:CT-TEMP",W
- call writeln TempFile,Select
- call close TempFile
- Set = 1
- end
- else do
- Set = 0
- call open TempFile,"RAM:CT-TEMP",R
- line = readln(TempFile)
- parse var line TempNum
- call close TempFile
- if TempNum ~= Select then do
- Set = 1
- call open TempFile,"RAM:CT-TEMP",W
- call writeln TempFile,Select
- call close TempFile
- 'Iclp'
- end
- end
-
- Address CT_1 ScreenToFront
- if WhichScript = 1 then do
- Address CT_1 OpenMessage "Gnusto Program Is Now Converting File!"
- NewName = TempDirFile
- Address command "C:Gnusto >NIL: "InFile" "NewName" image saver iff sy "value(0)" sx "value(752)" sn bestup"
- Address CT_1 CloseMessage
- 'Aloa'NewName
- Address command "Delete >NIL: "TempDirFile
- end
- call SubRoutine(FileNum,TotalNum)
-
- if Set = 1 then
- call SaveClip(OutFile.Select)
- if WhichScript = TotalScript then do
- do i = 1 to FrameRepeat
- do j = 1 to FrameField
- 'Apfc'
- 'Apfc'
- end
- end
- end
- if FileNum = TotalNum then do
- if WhichScript = TotalScript then do
- 'Iclp'
- address command "Delete >NIL: RAM:CT-TP"
- address command "Delete >NIL: RAM:CT-TEMP"
- end
- 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
-
- 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 FYI Title
- Address CT_1 Abort
- Address CT_1 Quit
- exit
-
-