View Single Post
Hey, so I'm almost finished with my bulk export applescript for OmniOutliner. I've got it working but one last issue I'm having is I cannot seem to figure out how to select the export file type with the exception of .rtf which OO4 seems to like as its default for some reason. Here's the excerpt from the OO applescript dictionary:

Code:
export specifier : the object for the command
   to file : Where to place the exported document.
   [as text] : The name of a writable file type to use when writing the document. Defaults to the appropriate type for the path extension on the export destination.
Now there is only one file type I've been able to get to work, ".rtf", and this is done by just specifying the extension in the file name and not using the "as text" modifier at all. Using any other extension besides ".rtf" causes an error, even though the description above says OO will "default to the appropriate type for the path extension":

Code:
set outputPath to POSIX file ("/Users/mmarotta/Google Drive/Outliner iphone copies/" & theName & ".rtf")
	
	tell application "OmniOutliner"
		tell front document
			export to outputPath
			close
		end tell
	end tell
So since simply changing the extension does not work I went on to try the "[as text]" specifier to manually specify the file format to use. However, no matter what I've tried I always get an error like "OmniOutliner got an error: "HTML" is not a writable file type." no matter what I put after the "as" command:

Code:
set outputPath to POSIX file ("/Users/mmarotta/Google Drive/Outliner iphone copies/" & theName & ".html")
	
	tell application "OmniOutliner"
		tell front document
			export to outputPath as "HTML"
			close
		end tell
	end tell
I've tried everything I could think of after the "as" command, "HTML" "HTML (Dynamic)" ".html" "Microsoft Word Document" "docx" ".docx" I've tried removing the quotes, putting parentheses around it, adding brackets around the 'as' command as shown in the dictionary but none of it seems to work (and I always made sure to have the matching file extension in the output name). Even RTF which I know works without the "as" specifier stops working when I add "as rtf" using any of the above variations.

I must be missing something, how am I supposed to use the "as" command to specify what export file format for OO to use?

Last edited by random1destiny; 2014-03-24 at 07:32 PM..