Is it possible to display the script that was retrieved with getscript?

asked 2021-07-20 17:25:33 +0200

newskier10 gravatar image

So I was reading through the libreoffice article on executing python macros from basic. ( and understand how to invoke a macro with this code:

    Option Explicit

Public Function GetPythonScript(macro As String, _
        Optional location As String) As
    If IsMissing(location) Then location = "user"
    Dim mspf As Object ''
    Dim sp As Object ' compatible'
    Dim uri As String
    If location="document" Then
        sp = ThisComponent.getScriptProvider()
        mspf = CreateUNOService("")
        sp = mspf.createScriptProvider("")
    End If
    uri = ""& macro &"?language=Python&location="& location
    GetPythonScript = sp.getScript(uri)
End Function ' GetPythonScript

Private scr As Object '

Private Property Get ComputerName As String
    '''Workstation name'''
    scr = GetPythonScript("$computer_name", "document")
    ComputerName = scr.invoke(Array(), Array(), Array())
End Property ' ComputerName

And that all makes sense. My question is, is there some way to display the retrieved script? Something like scr.script or something? Is there any documentation that has the available properties and functions of the script object?

edit retag flag offensive close merge delete