home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 19 / MacAddict_019_1998_03.iso / Media / Config.dxr / 00028.ls < prev    next >
Encoding:
Text File  |  1997-12-18  |  1.1 KB  |  46 lines

  1. on mouseUp
  2.   writeToFile()
  3. end
  4.  
  5. on writeToFile
  6.   global myfile, theLocation, finalPath
  7.   if objectp(myfile) then
  8.     set myfile to 0
  9.   end if
  10.   set myfile to new(xtra("fileio"))
  11.   setFilterMask(myfile, "ALL FILES, *.*, TEXT FILES, *.TXT")
  12.   set theLocation to displayOpen(myfile)
  13.   if not voidp(theLocation) then
  14.     checkFile()
  15.   else
  16.     alert("You did not select your Web Browser.")
  17.   end if
  18.   closeFile(myfile)
  19.   set myfile to 0
  20. end
  21.  
  22. on checkFile
  23.   global myfile, theLocation, finalPath
  24.   put theLocation
  25.   set finalPath to field "OSPath"
  26.   if the machineType = 256 then
  27.     openFile(myfile, finalPath & "\BROWSER.TXT", 0)
  28.   else
  29.     openFile(myfile, finalPath & "BROWSER.TXT", 0)
  30.   end if
  31.   if status(myfile) = 0 then
  32.     delete(myfile)
  33.     closeFile(myfile)
  34.   end if
  35.   put theLocation into field "browserLoc"
  36.   set finalPath to field "OSPath"
  37.   if the machineType = 256 then
  38.     createFile(myfile, finalPath & "\BROWSER.TXT")
  39.     openFile(myfile, finalPath & "\BROWSER.TXT", 0)
  40.   else
  41.     createFile(myfile, finalPath & "BROWSER.TXT")
  42.     openFile(myfile, finalPath & "BROWSER.TXT", 0)
  43.   end if
  44.   writeString(myfile, theLocation)
  45. end
  46.