2005/11/01 13:19:11 jbu 1.2.34.1: #i44632# text is now append to end of document as the other HelloWorld examples do (contributed by bmarcelly)
14 lines
480 B
Python
14 lines
480 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 XTextRange at the end of the document
|
|
tRange = text.End
|
|
#and set the string
|
|
tRange.String = "Hello World (in Python)"
|
|
return None
|