Private Property Get ComputerName As String Private scr As Object ' .provider.XScript XScript = scriptPro.Option Compatible ' Properties are supported ScriptName = ":"+library+"."+module+"."+script+"?language=Basic&location=application" ScriptPro = mspf.createScriptProvider("") Mspf = sm.createInstanceWithContext(".provider.MasterScriptProviderFactory", uno.getComponentContext()) Sm = uno.getComponentContext().ServiceManager """Outputs the specified strings or numeric expressions in a dialog box."""įrom .provider import XScriptĭef _getScript(script: str, library='Standard', module='uiScripts') -> XScript: Res = xScript.invoke((prompt,title,defaultValue), (), ()) """ Displays a prompt in a dialog box at which the user can enter text.""" Res = xScript.invoke((prompt,buttons,title), (), ())ĭef InputBox(prompt: str, title='LibreOffice', defaultValue='') -> str: """ Displays a dialog box containing a message and returns a value.""" > age = ui.InputBox('How old are you?', title="Hi")Ĭopy screen_io Python module in My macros within /Scripts/python/pythonpath,Ĭopy uiScripts Basic module in My macros Standard Basic library,ĭef MsgBox(prompt: str, buttons=0, title='LibreOffice') -> int: > rc = ui.MsgBox(reply, title="Confirmation of phrase") > reply = ui.InputBox('Please enter a phrase', title='Dear user', default="here.") The API Scripting Framework is used to perform Basic, BeanShell, JavaScript and Python inter-languages function calls. The latter proposes a syntax that is intentionally close to that of Basic, and uses a Python module next to a Basic module. Python alternatives exist relying either on LibreOffice API Abstract Windowing Toolkit, either on Python to Basic function calls. LibreOffice Basic proposes InputBox(), Msgbox() and Print() screen I/O functions. The Alternative Python Script Organizer (APSO) extension offers a msgbox() function out of its apso_utils module.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |