diff options
Diffstat (limited to 'scripting/examples')
-rw-r--r-- | scripting/examples/python/HelloWorld.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripting/examples/python/HelloWorld.py b/scripting/examples/python/HelloWorld.py index cc634c265b..7f5b45c8cd 100644 --- a/scripting/examples/python/HelloWorld.py +++ b/scripting/examples/python/HelloWorld.py @@ -6,9 +6,8 @@ def HelloWorldPython( ): 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 ) +#create an XTextRange at the end of the document + tRange = text.End +#and set the string + tRange.String = "Hello World (in Python)" return None - |