home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1998 December / WPCDEC98.ISO / dxrs / Mainmn12.dxr / internet_20_INTLaunchWWW.ls < prev    next >
Encoding:
Text File  |  1998-10-12  |  2.4 KB  |  77 lines

  1. on INTLaunchWWW
  2.   global IntBrowserAlOption
  3.   set theApp to getExtensionApp("HTM")
  4.   put "theapp" && theApp
  5.   if word 1 of theApp = "Error:" then
  6.     set IntBrowserAlOption to 2
  7.     NewINTBrowserAlert()
  8.   else
  9.     put theApp into field "INTLocation"
  10.     set FirstSlash to 0
  11.     repeat with t = 1 to the number of chars in field "INTLocation"
  12.       if char t of field "INTLocation" = "\" then
  13.         if FirstSlash = 0 then
  14.           set FirstSlash to t
  15.           next repeat
  16.         end if
  17.         set LastSlash to t
  18.       end if
  19.     end repeat
  20.     set folderLoc to char FirstSlash + 1 to LastSlash - 1 of field "INTLocation"
  21.     set letterN to char FirstSlash - 2 of field "INTLocation"
  22.     set NumOf to the number of chars in field "INTLocation"
  23.     set Exename to char LastSlash + 1 to NumOf of field "INTLocation"
  24.     repeat with t = 1 to 200
  25.       set fname to getNthFileNameInFolder(letterN & ":\" & folderLoc, t)
  26.       if fname = EMPTY then
  27.         put "not found"
  28.         set fname to 0
  29.         exit repeat
  30.       end if
  31.       if fname = Exename then
  32.         put "executable found"
  33.         set fname to 1
  34.         exit repeat
  35.       end if
  36.     end repeat
  37.     case fname of
  38.       0:
  39.         set IntBrowserAlOption to 1
  40.         NewINTBrowserAlert()
  41.       1:
  42.         repeat with t = 1 to the number of chars in Exename
  43.           if char t of Exename = "." then
  44.             set howmany to t
  45.             exit repeat
  46.           end if
  47.         end repeat
  48.         set shortexename to char 1 to howmany - 1 of Exename
  49.         put "shortexename", shortexename
  50.         set tasklistStore to gMasterAppObject(mGetTaskList)
  51.         repeat with t = 1 to the number of lines in tasklistStore
  52.           set taskLinet to line t of tasklistStore
  53.           put "taskLinet", taskLinet
  54.           repeat with d = 1 to the number of chars in taskLinet
  55.             if char d of taskLinet = "," then
  56.               set howmany to d
  57.               exit repeat
  58.             end if
  59.           end repeat
  60.           set tasknamet to char 1 to howmany - 1 of taskLinet
  61.           if tasknamet = shortexename then
  62.             set INTBrowserRunning to 1
  63.             exit repeat
  64.           end if
  65.         end repeat
  66.         case INTBrowserRunning of
  67.           1:
  68.             put "browserrunning"
  69.             newINTLaunchAlert()
  70.           0:
  71.             newINTLaunchAlert()
  72.             put "browsernotrunning"
  73.         end case
  74.     end case
  75.   end if
  76. end
  77.