30 May 2008 - 21:05AppleScript - Exporting Omnifocus Perspective to HTML

Right then… No posts on here for about a year. Not much will change in the near future, and I’m also not going to be making any more icons either. Leopards 512px icon resources look amazing, but unfortunately mean that it takes much more effort to make an icon look good at higher resolutions, effort I don’t want to make. So I’ll be mothballing the icons category. Anyway, back to the reason for this post.

I’ve been getting into OmniFocus recently and wanted a way to view my tasks on my iPhone on the go. What better than the HTML export - but exporting a perspective and uploading the file was just taking too many clicks. The following applescript may help - point Automator at the created file using your uploader of choice and you’ll be set. The trick to exporting OmniFocus tasks lies in exporting a pre-made perspective and opening that ‘document’ to do the export with. So make yourself a perspective of what you’d like exported, save that, and use it in the AppleScript. I’m sure you can work it out.

tell application "OmniFocus" to tell default document
open "Disk:Users:yourusername:Library:Application Support:OmniFocus:Perspectives:perspectivename.ofocus-perspective"
end tell
tell application "OmniFocus" to tell default document
save in "Users:yourusername:Desktop:filename" as "HTML"
end tell

UPDATE 3rd July 2008 - removed last 2 extra lines of code left from a bad copy/past from Automator.

Hope this saves someone the 15 mins of googling it took me to knock this up. Enjoy.

No Comments | Tags: applescript, code, omnifocus