home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.graphics
- Path: sparky!uunet!netnews!bandy
- From: bandy@netnews.jhuapl.edu (Mike Bandy)
- Subject: Re: ADPro ARexx batch program...
- Message-ID: <C0IIEM.KG4@netnews.jhuapl.edu>
- Keywords: Batch program for ADPro
- Organization: JHU/Applied Physics Laboratory
- References: <1992Dec29.131238@tpsunserv1.Prime.COM>
- Date: Fri, 8 Jan 1993 01:49:33 GMT
- Lines: 147
-
- miker@tpsunserv1.Prime.COM (Mike Roberts) writes:
-
- >Does anyone know of a bach file handeling program for ADPro?
-
- >I am in need of a program (ARexx I assume since it talks to ADPro) that will use a
- >list of GIF file names within a logfile to feed ADPro in generating HAM files. Does this
- >make sense to anyone?
-
- I just created a little ADPro command script that I can share with you.
- It's not exactly what you wanted, but a little documentation search can
- tweek it to do what you want. I'll leave that as an exercise for you. :)
- What I had was a bunch of IFF files that were too big to make a Dpaint IV
- anim out of, so I wanted to shrink all of them to 160x400.
-
- Use is like this:
- 1) Clip the enclosed routine and put it into your REXX: directory. Name it
- something like 160x400.adpro.
- 2) Fire up ADPro and hit F10. It brings up a file requester of REXX:
- directory. Select 160x400.adpro and hit OK.
- 3) 160x400 runs and brings up a file requester. Hold the SHIFT key and
- click on all files to be converted. When you have all of them hit OK.
- 4) For each file it:
- loads it
- renders it
- displays it momentarily
- converts it to 160x400
- renders it
- displays it momentarily
- saves it back to the same filename with "160x400" appended
-
- Note that several OKAY1 commands are commented out. If you enable them
- (by removing leading and trailing '/*' '*/') it will pause
- and give you a little feedback -- but it won't run unattended.
-
- If you have real problems getting it to do what you want, e-mail me and
- we'll work on it. Arexx programming with Adpro is a very powerful skill
- to add to your bag of tricks and the enclosed script covers the hard parts.
-
- -- 8< -- 8< -- 8< -- 8< -- 8< -- Clip here -- 8< -- 8< -- 8< -- 8< -- 8<
-
- /*
- ** Read in list of IFF files and convert them all to 160x400 pixels.
- ** Michael Bandy 1/7/92
- */
-
- OPTIONS RESULTS
- ADDRESS "ADPro"
-
- NewLine = '0A'X
-
- /* ADPro screen to front before displaying requesters */
- ADPRO_TO_FRONT
-
- /* Get a bunch of files */
- GETFILES '"Files to be diddled"'
- File_List = ADPRO_RESULT
- File_Count = WORDS( ADPRO_RESULT )
-
- /* Walk the list */
- I = 1
- DO WHILE (I <= File_Count)
- /* Get the next file and convert to 160x400 */
- File = WORD( File_List, I )
-
- /* Show the filename -- DEBUG */
- /** String = "File = ~" File "~ ..." **/
- /** OKAY1 String **/
-
- /* Display file name -- but drop all "LOG:DIR/DIR/" stuff */
- Strip = SUBSTR( File, 2, LENGTH( File ) - 2 ) /* No "s */
- File1 = Strip /* Save it for SAVE */
- /* remainder to blank line is so that the filename can be displayed
- ** without the associated dev:dir/subdir/ stuff that makes the filename
- ** not fit in a requester ... */
- P = POS( ':', Strip )
- IF P ~= 0 THEN DO
- Strip = SUBSTR( Strip, P+1 )
- END
- DO UNTIL (P = 0)
- P = POS( '/', Strip )
- IF P ~= 0 THEN DO
- Strip = SUBSTR( Strip, P+1 )
- END
- END
-
- /* Show the filename -- DEBUG */
- /** String = "Loading " Strip " ..." **/
- /** OKAY1 String **/
-
- /* Load it */
- LFORMAT "IFF"
- LOAD File
- IF RC ~= 0 THEN DO
- OKAY1 "Load failed!"
- EXIT
- END
-
- /* Display it so far for 3 seconds */
- EXECUTE
- ADPRO_DISPLAY
- PAUSE 50*3
- ADPRO_TO_FRONT
-
- /* Shrink to 160x400 */
- ABS_SCALE 160 400
- IF RC ~= 0 THEN DO
- OKAY1 "Scale failed!"
- EXIT
- END
-
- /* Prepare to be saved; show momentarily */
- EXECUTE
- ADPRO_DISPLAY
- PAUSE 50*3
- ADPRO_TO_FRONT
-
- /* Append "160x140" to filename and save it back into same dir */
- Out_File = File1 || '160x400'
-
- /* Show the filename -- DEBUG */
- /** String = "Saving " Out_File " ..." **/
- /** OKAY1 String **/
-
- SFORMAT IFF
- SAVE Out_File IMAGE
- IF RC ~= 0 THEN DO
- OKAY1 "Save failed!"
- EXIT
- END
-
- /* Advance file counter and do it again */
- I = I + 1
- END
-
- /* We're done - stick up a requester */
- ADPRO_TO_FRONT
- OKAY1 "Done!"
-
- EXIT
-
- -- 8< -- 8< -- 8< -- 8< -- 8< -- Clip here -- 8< -- 8< -- 8< -- 8< -- 8<
-
- --
-
- Mike Bandy
- bandy@aplcomm.jhuapl.edu
- Johns Hopkins University / Applied Physics Lab
-