I am following the tutorail on Linux.com by Dimitri Propov on having an interface to execute a query on firefox.

The script seem to work except that it doesn't launch firefox itself. I wonder if the Shell should have a special treatment on Linux as opposed to Linux. The faulty line is:

  Shell("/usr/bin/firefox",1, URLArray(CurrentItemPos) & LookupWord.String)


Here is the code:
REM  *****  BASIC  *****
REM This tutorial comes from Linux.com
REM The Macro is supposed to make a call of Query

  Sub LookupWithGUI()

  Dim Dialog As Object, Library As Object
  Dim TheDialog As Object, DialogField As Object
  Dim exitOK As String, CurrentItemPos As Integer

  URLArray=Array("http://en.wikipedia.org/wiki/",_
  "http://dictionary.cambridge.org/results.asp?searchword=",_
  "http://www.google.com/search?q=define%3A";)

  ThisDoc=ThisComponent
  LookupWord=ThisDoc.CurrentController.getViewCursor

  exitOK=com.sun.star.ui.dialogs.ExecutableDialogResults.OK
  Library=DialogLibraries.GetByName("GUI")
  TheDialog=Library.GetByName("Dialog1")

  Dialog=CreateUnoDialog(TheDialog)
  DialogField=Dialog.GetControl("ListBox1")
  DialogField.SelectItemPos(1, True)

  If Dialog.Execute=exitOK Then
  CurrentItemPos=DialogField.SelectedItemPos
  Shell("/usr/bin/firefox",1, URLArray(CurrentItemPos) & LookupWord.String)
  End If

  Dialog.Dispose

  End Sub



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to