<?xml version="1.0" encoding="ISO-8859-1"?>
<ss:description type="action" id="com.autodesk.XML.WriteToFile"
		xmlns:ss="urn:Autodesk:Server"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="urn:Autodesk:Server Schema.xsd">
	<ss:title>Write to File</ss:title>
	<ss:section>Files</ss:section>
	<ss:input>com.autodesk.objects.TextObject</ss:input>
	<ss:output>com.autodesk.objects.TextObject</ss:output>
	<ss:options>
		<ss:label/>
		<ss:option name="filename">
			<ss:label>Enter a filename </ss:label>
			<ss:tooltip>Enter the name of a file that the input will be written to.</ss:tooltip>
			<ss:filename>
				<ss:filter pattern=".*">
					<ss:text lang="en_US">All Files</ss:text>
				</ss:filter>
			</ss:filename>
		</ss:option>
	</ss:options>
	<ss:code>
from com.autodesk.objects import TextObject
def main(input, filename):
	try:
		file = open(filename, "w")
		text = input.getText()
		if text != None:
			for str in text:
				file.write(str + '\n')

		file.close()
	except IOError:
		print "Error: WriteToXML unable to open " + filename

	return input
	</ss:code>
</ss:description>
