List Info

Thread: Launching an application from Shell




Launching an application from Shell
user name
2007-04-13 12:39:00
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.wikiped
ia.org/wiki/",_
   "http://dictionary.cambridge.org/results.asp?searchw
ord=",_
   "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: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )