@Mods
Da es sich IMHO nicht wirklich um eine Programmierfrage handelt, poste ich es mal hier, falls ein Mod ein besseres Forum kennt bitte verschieben. In dem Fall verzeiht auch die Umstände
@Topic:
Ich versuch mich gerade darin, OpenOffice mit Python-Macros zu erweitern.
Blöderweise erkennt es NUR mein Macro nicht.
Code: Alles auswählen
#Ein schönes Macro
import uno
from com.sun.star.datatransfer.clipboard import table
def HideUseless():
"""Schreibt Test in die Zwischenablage"""
Tabelle=table()
Tabelle.contents="Test"
return None
g_exportedScripts = HideUseless,
Mein Problem ist, dass wenn ich obigen Code im Korrekten Ordner speichere OpenOffice zwar in der Macroliste einen Eintrag mit dem Dateinamen hinzufügt, darin aber keine Funktion erkennt.
Als Vergleich ein Hello-World-Programm, das funktioniert (ist NICHT von mir)
Code: Alles auswählen
# 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
Kurzum: Irgendwer ne Idee, warum es nicht erkannt wird?
Danke im Vorraus
Mfg PureFranky