home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1998 July / WPCJUL98.ISO / DXRS / MAINMENU.DXR / internet_20_INTLaunchWWW.ls < prev    next >
Encoding:
Text File  |  1998-05-11  |  2.3 KB  |  76 lines

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