home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Script / GTQLib1.2.as folder / Sample Scripts / PrintOnImageWriter < prev    next >
Encoding:
Text File  |  1994-05-03  |  723 b   |  28 lines  |  [TEXT/ToyS]

  1. on PrintObjects(cont, objs)
  2.     tell application "Finder" to print cont items objs
  3. end PrintObjects
  4.  
  5. on container(i)
  6.     set s to i as string
  7.     set oldDelimiters to AppleScript's text item delimiters
  8.     set AppleScript's text item delimiters to {":"}
  9.     set n to number of text items in s
  10.     set res to text item 1 of s
  11.     repeat with counter from 2 to n - 1
  12.         set res to res & ":" & (text item counter of s)
  13.     end repeat
  14.     set AppleScript's text item delimiters to oldDelimiters
  15.     return ((res & ":") as string)
  16. end container
  17.  
  18. on PrintFile(i)
  19.     PrintObjects(alias container(i), {i})
  20. end PrintFile
  21.  
  22. on open f
  23.     set f to f as list
  24.     set printer to "ImageWriter" using printer port
  25.     repeat with i in f
  26.         PrintFile(i as alias)
  27.     end repeat
  28. end open