home *** CD-ROM | disk | FTP | other *** search
/ GU 15 - Background Photo Collection - Hanabi / gu15.iso / pc / browser.exe / browser.DXR / 00041_LinkFileUtility.ls < prev    next >
Encoding:
Text File  |  1996-09-12  |  7.3 KB  |  206 lines

  1. on listlinkedfile n, m
  2.   repeat with i = n to m
  3.     put i && the fileName of cast i
  4.   end repeat
  5. end
  6.  
  7. on changelinkedfilepath oldpath, newpath, n, m
  8.   set oldpath to folderfrompath(oldpath)
  9.   repeat with i = n to m
  10.     set path to the fileName of cast i
  11.     if path <> EMPTY then
  12.       set folder to folderfrompath(path)
  13.       if folder = oldpath then
  14.         set file to filefrompath(path)
  15.         set folder to folderfrompath(path)
  16.         set the fileName of cast i to newpath & ":" & file
  17.       end if
  18.     end if
  19.     put i && the fileName of cast i
  20.   end repeat
  21. end
  22.  
  23. on changelinkedfilepfe oldpath, newpath, n, m
  24.   set oldfolder to folderfrompath(oldpath)
  25.   set oldfile to filefromfile(filefrompath(oldpath))
  26.   set oldext to extentionfromfile(oldpath)
  27.   set newfolder to folderfrompath(newpath)
  28.   set newfile to filefromfile(filefrompath(newpath))
  29.   set newext to extentionfromfile(newpath)
  30.   repeat with i = n to m
  31.     set path to the fileName of cast i
  32.     if path <> EMPTY then
  33.       set folder to folderfrompath(path)
  34.       set file to filefromfile(filefrompath(path))
  35.       set ext to extentionfromfile(path)
  36.       set st to offset(oldfile, file)
  37.       if (folder = oldfolder) and (st <> 0) and (ext = oldext) then
  38.         set file to newfile & char st + length(oldfile) to the number of chars in file of file
  39.         set the fileName of cast i to newfolder & ":" & file & "." & newext
  40.       end if
  41.     end if
  42.     put i && path && "->" && the fileName of cast i
  43.   end repeat
  44. end
  45.  
  46. on changelinkedpictobmp n, m
  47.   repeat with i = n to m
  48.     set path to the fileName of cast i
  49.     if path <> EMPTY then
  50.       set extention to extentionfromfile(path)
  51.       if (extention = "PIC") or (extention = "pic") then
  52.         set file to filefrompath(path)
  53.         set folder to folderfrompath(path)
  54.         set filebody to filefromfile(file)
  55.         set the fileName of cast i to folder & ":" & filebody & "." & "BMP"
  56.         put folder & ":" & filebody & "." & "BMP"
  57.         put the fileName of cast i
  58.       end if
  59.     end if
  60.   end repeat
  61. end
  62.  
  63. on changelinkedbmptopict n, m
  64.   repeat with i = n to m
  65.     set path to the fileName of cast i
  66.     if path <> EMPTY then
  67.       set extention to extentionfromfile(path)
  68.       if (extention = "BMP") or (extention = "bmp") then
  69.         set file to filefrompath(path)
  70.         set folder to folderfrompath(path)
  71.         set filebody to filefromfile(file)
  72.         set the fileName of cast i to folder & ":" & filebody & "." & "PIC"
  73.         put the fileName of cast i
  74.       end if
  75.     end if
  76.   end repeat
  77. end
  78.  
  79. on correctlinkfile machine
  80.   set bpath to the pathName
  81.   if machine = 256 then
  82.     set the fileName of cast 1 to bpath & "datastuf:" & "gs0001.bmp"
  83.     put the fileName of cast 1
  84.     set the fileName of cast 2 to bpath & "datastuf:" & "gs0002.bmp"
  85.     put the fileName of cast 2
  86.     set the fileName of cast 3 to bpath & "datastuf:" & "gs0003.bmp"
  87.     put the fileName of cast 3
  88.     set the fileName of cast 4 to bpath & "datastuf:" & "gs0004.bmp"
  89.     put the fileName of cast 4
  90.     set the fileName of cast 5 to bpath & "datastuf:" & "gs0005.bmp"
  91.     put the fileName of cast 5
  92.     set the fileName of cast 6 to bpath & "datastuf:" & "gs0006.bmp"
  93.     put the fileName of cast 6
  94.     set the fileName of cast 7 to bpath & "datastuf:" & "gs0007.bmp"
  95.     put the fileName of cast 7
  96.     set the fileName of cast 8 to bpath & "datastuf:" & "gs0010.bmp"
  97.     put the fileName of cast 8
  98.     set the fileName of cast 9 to bpath & "datastuf:" & "gs0011.bmp"
  99.     put the fileName of cast 9
  100.     set the fileName of cast 10 to bpath & "datastuf:" & "gs0012.bmp"
  101.     put the fileName of cast 10
  102.     set the fileName of cast 11 to bpath & "datastuf:" & "gs00bk.bmp"
  103.     put the fileName of cast 11
  104.     set the fileName of cast 12 to bpath & "datastuf:" & "gs00mb.bmp"
  105.     put the fileName of cast 12
  106.     repeat with i = 1 to 100
  107.       set cname to item 1 of line i of field "data"
  108.       set fname to cname & "." & "BMP"
  109.       put i
  110.       set the fileName of cast (104 + i) to bpath & "120_8:" & fname
  111.       set the name of cast (104 + i) to "120" & cname
  112.       put the fileName of cast (104 + i) && the name of cast (104 + i)
  113.       set the fileName of cast (204 + i) to bpath & "240_8:" & fname
  114.       set the name of cast (204 + i) to "240" & cname
  115.       put the fileName of cast (204 + i) && the name of cast (204 + i)
  116.       set the fileName of cast (304 + i) to bpath & "640_8:" & fname
  117.       set the name of cast (304 + i) to "640" & cname
  118.       put the fileName of cast (304 + i) && the name of cast (304 + i)
  119.     end repeat
  120.   else
  121.     set the fileName of cast 1 to bpath & "datastuf:" & "gs0001.pic"
  122.     put the fileName of cast 1
  123.     set the fileName of cast 2 to bpath & "datastuf:" & "gs0002.pic"
  124.     put the fileName of cast 2
  125.     set the fileName of cast 3 to bpath & "datastuf:" & "gs0003.pic"
  126.     put the fileName of cast 3
  127.     set the fileName of cast 4 to bpath & "datastuf:" & "gs0004.pic"
  128.     put the fileName of cast 4
  129.     set the fileName of cast 5 to bpath & "datastuf:" & "gs0005.pic"
  130.     put the fileName of cast 5
  131.     set the fileName of cast 6 to bpath & "datastuf:" & "gs0006.pic"
  132.     put the fileName of cast 6
  133.     set the fileName of cast 7 to bpath & "datastuf:" & "gs0007.pic"
  134.     put the fileName of cast 7
  135.     set the fileName of cast 8 to bpath & "datastuf:" & "gs0010.pic"
  136.     put the fileName of cast 8
  137.     set the fileName of cast 9 to bpath & "datastuf:" & "gs0011.pic"
  138.     put the fileName of cast 9
  139.     set the fileName of cast 10 to bpath & "datastuf:" & "gs0012.pic"
  140.     put the fileName of cast 10
  141.     set the fileName of cast 11 to bpath & "datastuf:" & "gs00bk.pic"
  142.     put the fileName of cast 11
  143.     set the fileName of cast 12 to bpath & "datastuf:" & "gs00mb.pic"
  144.     put the fileName of cast 12
  145.     repeat with i = 1 to 100
  146.       set cname to item 1 of line i of field "data"
  147.       set fname to cname & "." & "PIC"
  148.       put i
  149.       set the fileName of cast (104 + i) to bpath & "120x90:" & fname
  150.       set the name of cast (104 + i) to "120" & cname
  151.       put the fileName of cast (104 + i) && the name of cast (104 + i)
  152.       set the fileName of cast (204 + i) to bpath & "240x180:" & fname
  153.       set the name of cast (204 + i) to "240" & cname
  154.       put the fileName of cast (204 + i) && the name of cast (204 + i)
  155.       set the fileName of cast (304 + i) to bpath & "640x480:" & fname
  156.       set the name of cast (304 + i) to "640" & cname
  157.       put the fileName of cast (304 + i) && the name of cast (304 + i)
  158.     end repeat
  159.   end if
  160.   correctregpoint(105, 204)
  161.   saveMovie()
  162.   unLoadCast(105, 204)
  163.   correctregpoint(205, 304)
  164.   saveMovie()
  165.   unLoadCast(205, 304)
  166.   correctregpoint(305, 350)
  167.   saveMovie()
  168.   unLoadCast(305, 350)
  169.   correctregpoint(351, 404)
  170.   saveMovie()
  171.   unLoadCast(351, 404)
  172. end
  173.  
  174. on filefrompath path
  175.   set saved to the itemDelimiter
  176.   set the itemDelimiter to ":"
  177.   set ret to the last item in path
  178.   set the itemDelimiter to saved
  179.   return ret
  180. end
  181.  
  182. on folderfrompath path
  183.   set saved to the itemDelimiter
  184.   set the itemDelimiter to ":"
  185.   set n to the number of items in path
  186.   set ret to item 1 to n - 1 of path
  187.   set the itemDelimiter to saved
  188.   return ret
  189. end
  190.  
  191. on extentionfromfile file
  192.   set saved to the itemDelimiter
  193.   set the itemDelimiter to "."
  194.   set ret to the last item in file
  195.   set the itemDelimiter to saved
  196.   return ret
  197. end
  198.  
  199. on filefromfile file
  200.   set saved to the itemDelimiter
  201.   set the itemDelimiter to "."
  202.   set ret to item 1 of filefrompath(file)
  203.   set the itemDelimiter to saved
  204.   return ret
  205. end
  206.