forked from amazingfate/loongoffice
2004/12/12 19:46:22 jbu 1.1.2.1: Ã#i25309# moved scripts one level higher, as files are now also container for scripts
15 lines
489 B
Python
15 lines
489 B
Python
# HelloWorld python script for the scripting framework
|
|
|
|
def HelloWorldPython( ):
|
|
"""Prints the string 'Hello World(in Python)' into the current document"""
|
|
#get the doc from the scripting context which is made available to all scripts
|
|
model = XSCRIPTCONTEXT.getDocument()
|
|
#get the XText interface
|
|
text = model.Text
|
|
#create an XTextCursor
|
|
cursor = text.createTextCursor()
|
|
#and insert the string
|
|
text.insertString( cursor, "Hello World (in Python)", 0 )
|
|
return None
|
|
|