home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / graphics / 8514 < prev    next >
Encoding:
Text File  |  1993-01-07  |  4.2 KB  |  159 lines

  1. Newsgroups: comp.sys.amiga.graphics
  2. Path: sparky!uunet!netnews!bandy
  3. From: bandy@netnews.jhuapl.edu (Mike Bandy)
  4. Subject: Re: ADPro ARexx batch program...
  5. Message-ID: <C0IIEM.KG4@netnews.jhuapl.edu>
  6. Keywords: Batch program for ADPro
  7. Organization: JHU/Applied Physics Laboratory
  8. References: <1992Dec29.131238@tpsunserv1.Prime.COM>
  9. Date: Fri, 8 Jan 1993 01:49:33 GMT
  10. Lines: 147
  11.  
  12. miker@tpsunserv1.Prime.COM (Mike Roberts) writes:
  13.  
  14. >Does anyone know of a bach file handeling program for ADPro?  
  15.  
  16. >I am in need of a program (ARexx I assume since it talks to ADPro) that will use a 
  17. >list of GIF file names within a logfile to feed ADPro in generating HAM files.  Does this
  18. >make sense to anyone?
  19.  
  20. I just created a little ADPro command script that I can share with you.
  21. It's not exactly what you wanted, but a little documentation search can 
  22. tweek it to do what you want.  I'll leave that as an exercise for you. :)
  23. What I had was a bunch of IFF files that were too big to make a Dpaint IV
  24. anim out of, so I wanted to shrink all of them to 160x400.
  25.  
  26. Use is like this:
  27. 1) Clip the enclosed routine and put it into your REXX: directory.  Name it
  28. something like 160x400.adpro.
  29. 2) Fire up ADPro and hit F10.  It brings up a file requester of REXX:
  30. directory.  Select 160x400.adpro and hit OK.
  31. 3) 160x400 runs and brings up a file requester.  Hold the SHIFT key and
  32. click on all files to be converted.  When you have all of them hit OK.
  33. 4) For each file it:
  34.     loads it
  35.     renders it
  36.     displays it momentarily
  37.     converts it to 160x400
  38.     renders it
  39.     displays it momentarily
  40.     saves it back to the same filename with "160x400" appended
  41.  
  42. Note that several OKAY1 commands are commented out.  If you enable them
  43. (by removing leading and trailing '/*' '*/') it will pause
  44. and give you a little feedback -- but it won't run unattended.
  45.  
  46. If you have real problems getting it to do what you want, e-mail me and
  47. we'll work on it.  Arexx programming with Adpro is a very powerful skill 
  48. to add to your bag of tricks and the enclosed script covers the hard parts.
  49.  
  50. -- 8< -- 8< -- 8< -- 8< -- 8< -- Clip here -- 8< -- 8< -- 8< -- 8< -- 8<
  51.  
  52. /*
  53. ** Read in list of IFF files and convert them all to 160x400 pixels.
  54. ** Michael Bandy  1/7/92
  55. */
  56.  
  57. OPTIONS RESULTS
  58. ADDRESS "ADPro"
  59.  
  60. NewLine = '0A'X
  61.  
  62. /* ADPro screen to front before displaying requesters */
  63. ADPRO_TO_FRONT
  64.  
  65. /* Get a bunch of files */
  66. GETFILES '"Files to be diddled"'
  67. File_List = ADPRO_RESULT
  68. File_Count = WORDS( ADPRO_RESULT )
  69.  
  70. /* Walk the list */
  71. I = 1
  72. DO WHILE (I <= File_Count)
  73. /* Get the next file and convert to 160x400 */
  74.     File = WORD( File_List, I )
  75.  
  76. /* Show the filename -- DEBUG */
  77. /**    String = "File = ~"  File  "~ ..."    **/
  78. /**    OKAY1 String                **/
  79.  
  80. /* Display file name -- but drop all "LOG:DIR/DIR/" stuff */
  81.     Strip = SUBSTR( File, 2, LENGTH( File ) - 2 )    /* No "s */
  82.     File1 = Strip            /* Save it for SAVE */
  83. /* remainder to blank line is so that the filename can be displayed
  84. ** without the associated dev:dir/subdir/ stuff that makes the filename
  85. ** not fit in a requester ...  */
  86.     P = POS( ':', Strip )
  87.     IF P ~= 0 THEN DO
  88.         Strip = SUBSTR( Strip, P+1 )
  89.     END
  90.     DO UNTIL (P = 0)
  91.         P = POS( '/', Strip )
  92.         IF P ~= 0 THEN DO
  93.             Strip = SUBSTR( Strip, P+1 )
  94.         END
  95.     END
  96.  
  97. /* Show the filename -- DEBUG */
  98. /**    String = "Loading "  Strip  " ..."    **/
  99. /**    OKAY1 String                **/
  100.  
  101. /* Load it */
  102.     LFORMAT "IFF"
  103.     LOAD File
  104.     IF RC ~= 0 THEN DO
  105.         OKAY1 "Load failed!"
  106.         EXIT
  107.     END
  108.  
  109. /* Display it so far for 3 seconds */
  110.     EXECUTE
  111.     ADPRO_DISPLAY
  112.     PAUSE 50*3
  113.     ADPRO_TO_FRONT
  114.  
  115. /* Shrink to 160x400 */
  116.     ABS_SCALE 160 400
  117.     IF RC ~= 0 THEN DO
  118.         OKAY1 "Scale failed!"
  119.         EXIT
  120.     END
  121.  
  122. /* Prepare to be saved; show momentarily */
  123.     EXECUTE
  124.     ADPRO_DISPLAY
  125.     PAUSE 50*3
  126.     ADPRO_TO_FRONT
  127.  
  128. /* Append "160x140" to filename and save it back into same dir */
  129.     Out_File = File1 || '160x400'
  130.  
  131. /* Show the filename -- DEBUG */
  132. /**    String = "Saving "  Out_File  " ..."    **/
  133. /**    OKAY1 String                **/
  134.  
  135.     SFORMAT IFF
  136.     SAVE Out_File IMAGE
  137.     IF RC ~= 0 THEN DO
  138.         OKAY1 "Save failed!"
  139.         EXIT
  140.     END
  141.  
  142. /* Advance file counter and do it again */
  143.     I = I + 1
  144. END
  145.  
  146. /* We're done - stick up a requester */
  147. ADPRO_TO_FRONT
  148. OKAY1 "Done!"
  149.  
  150. EXIT
  151.  
  152. -- 8< -- 8< -- 8< -- 8< -- 8< -- Clip here -- 8< -- 8< -- 8< -- 8< -- 8<
  153.  
  154. -- 
  155.  
  156.     Mike Bandy
  157.     bandy@aplcomm.jhuapl.edu
  158.     Johns Hopkins University / Applied Physics Lab
  159.