View Single Post
Is there a way to export multiple documents at once with Automator?

It seems like the filename has to be hardcoded in the export action, which makes it hard to use with several different files at once.

I was hoping that leaving the filename blank would make Outliner figure it out itself. I've got a bunch of outliner files that I want to convert to OPML, so that myfile.oo3 -> myfile.opml.

For now I'm using this applescript where the export action would go:

Code:
on run {input, parameters}
	set exportDir to "/tmp/opml/"
	try
		do shell script "mkdir '" & exportDir & "'"
	end try
	tell application "OmniOutliner"
		repeat with doc in input
			set s to doc's name
			set opmlName to texts 1 thru ((s's length) - 4) of s & ".opml"
			set outfile to exportDir & opmlName
			export doc to outfile as "OOOPMLDocumentType"
		end repeat
	end tell
	return input
end run