home *** CD-ROM | disk | FTP | other *** search
/ HP Idea Kits: Let's Celebrate / PHOTODLX.ISO / extras / diamar / photo.dxr / 00035.ls < prev    next >
Encoding:
Text File  |  1996-04-22  |  3.4 KB  |  131 lines

  1. on relink start, finish, size
  2.   if voidp(size) then
  3.     set size to 10000
  4.   end if
  5.   repeat with i = start to finish
  6.     if the castType of cast i = #bitmap then
  7.       set fname to the fileName of cast i
  8.       if (the size of cast i < size) and (fname > EMPTY) then
  9.         put fname
  10.         importFileInto(cast i, fname)
  11.       end if
  12.     end if
  13.   end repeat
  14.   put "done"
  15. end
  16.  
  17. on marchcast start, finish
  18.   if voidp(size) then
  19.     set size to 10000
  20.   end if
  21.   repeat with i = start to finish
  22.     if the castType of cast i = #bitmap then
  23.       set fname to the fileName of cast i
  24.       if fname > EMPTY then
  25.         put fname
  26.       end if
  27.     end if
  28.   end repeat
  29.   put "done"
  30. end
  31.  
  32. on castlist start, finish
  33.   if the paramCount = 1 then
  34.     set finish to start
  35.   end if
  36.   set fileObj to FileIO(mnew, "?write", "castlist.txt")
  37.   put the result
  38.   set delim to the itemDelimiter
  39.   set the itemDelimiter to ":"
  40.   repeat with i = start to finish
  41.     if (the castType of cast i = #bitmap) or (the castType of cast i = #digitalVideo) then
  42.       set fname to the last item in the fileName of cast i
  43.       if char 1 to 2 of fname = "SQ" then
  44.         set fname to char 1 to 5 of fname & "." & char 7 to 8 of fname
  45.       else
  46.         set fname to char 1 to offset(".", fname & ".") - 1 of fname
  47.       end if
  48.       if the width of cast i < the height of cast i then
  49.         set Orientation to "Portrait"
  50.       else
  51.         set Orientation to "Landscape"
  52.       end if
  53.       set theline to i & "," & fname & "," & Orientation
  54.       fileObj(mWriteString, theline & RETURN)
  55.     end if
  56.   end repeat
  57.   fileObj(mdispose)
  58.   set the itemDelimiter to delim
  59. end
  60.  
  61. on prefixpalette start, finish, prefix
  62.   repeat with i = start to finish
  63.     if the castType of cast i = #palette then
  64.       set the name of cast i to prefix & the name of cast i
  65.     end if
  66.   end repeat
  67.   put "done"
  68. end
  69.  
  70. on renamepalette start, finish, prefix
  71.   if voidp(prefix) then
  72.     set prefix to EMPTY
  73.   end if
  74.   repeat with i = finish to start
  75.     if the castType of cast i = #bitmap then
  76.       set p to the palette of cast i
  77.       set pname to the name of cast i
  78.       set the name of cast p to prefix & char 1 to 5 of pname
  79.     end if
  80.   end repeat
  81.   put "done"
  82. end
  83.  
  84. on parsefile startcast
  85.   global gFileIn, gFileOut
  86.   set fname to "TEXT"
  87.   set gFileIn to FileIO(mnew, "?read", fname)
  88.   if gFileIn < 0 then
  89.     exit
  90.   end if
  91.   set L to gFileIn(mGetLength)
  92.   set textcast to startcast
  93.   set castline to 26
  94.   set castline to 0
  95.   repeat while gFileIn(mGetPosition) <> L
  96.     set LineIn to gFileIn(mReadLine)
  97.     if LineIn = EMPTY then
  98.       exit repeat
  99.     end if
  100.     if castline = 0 then
  101.       set castline to integer(char 6 to 7 of item 1 of LineIn) + 1
  102.       put "starting at line " & castline
  103.     end if
  104.     set LineOut to parseLine(LineIn)
  105.     put LineOut into line castline of field textcast
  106.     set castline to castline + 1
  107.     if castline > 100 then
  108.       set castline to 1
  109.       set textcast to textcast + 1
  110.       put "Starting on cast" && textcast
  111.     end if
  112.   end repeat
  113.   gFileIn(mdispose)
  114. end
  115.  
  116. on parseLine theline
  117.   set save to the itemDelimiter
  118.   set the itemDelimiter to TAB
  119.   set n to the number of items in theline
  120.   set newLine to item 1 of theline
  121.   repeat with i = 2 to n
  122.     set aChunk to item i of theline
  123.     if (aChunk > EMPTY) and (aChunk <> RETURN) then
  124.       set newLine to newLine & "," & aChunk
  125.     end if
  126.   end repeat
  127.   set newLine to newLine & RETURN
  128.   set the itemDelimiter to save
  129.   return newLine
  130. end
  131.