The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

applescript to export to text file? Thread Tools Search this Thread Display Modes

I have drafted a script that when called will export my Omnifocus data to a text file. I then use Geektool to display this on my desktop as shown. This is working so far, but my script is VERY clumsy.

It sends keyboard commands to OmniFocus via system events which set the perspective, call up the export menu item, export the list to taskpaper format, sync (iPhone) and close the program. Because of the script's nature I've set it to only run if OmniFocus is closed else it might interrupt me as I'm working within the program. The script is called automatically every ten minutes by Geektool.

It is obnoxious to watch the program open, the keystrokes do their thing, and then watch the program close. It is also bothersome that I can't leave OmniFocus open to sync with the phone automatically every hour, or for an easy inbox dump via hotkeys.

Basically I'm looking for a more elegant solution for my goal: A script that operates at the program level rather than the system events level. I just don't know how to command OmniFocus to export a specific persepctive to the taskpaper format without using keyboard commands.

Is what I'm looking to do possible? Are there any resources I should consult? Would anyone be able to offer advice/help?

Anyhow, I've appended a link to a shot of the desktop and the clumsiness in question below. Thanks for any time spent helping,


tell application "System Events"
set num to count (every process whose name is "OmniFocus")
end tell
if num = 0 then
tell application "OmniFocus"
end tell
tell application "System Events"
tell process "OmniFocus"

keystroke "p" using {control down, command down}
keystroke return -- return key
keystroke "e" using {command down, option down}
keystroke return -- return key
keystroke "r" using {command down}
keystroke "q" using {command down}
keystroke "s" using {control down, command down}
end tell
end tell
end if
I haven't checked how they work, but there are some scripts at this thread that might help.

Thanks for the link, I did browse the archives looking at scripts and possible solutions. I didn't see this one. I think with the example code, some time and some Googleing I should be able to patch something a bit more elegant together.

Any other suggestions anyone?

Be Well,

Please email and ask us to add export to the AppleScript library, so you can do something like the following:
tell application "OmniFocus"
     tell default document
          export as "TaskPaper" to someFilePath
     end tell
end tell

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Applescript to write todays completed tasks to a text file december76 OmniFocus Extras 7 2010-09-02 12:03 PM
Export to text file CLUTTER charismatic OmniFocus 1 for Mac 2 2010-01-08 02:41 PM
Multiple file export via Applescript braindump OmniOutliner 3 for Mac 2 2008-01-12 05:27 PM
File extension issue for HTML export can overwrite plan file jrwilco1 OmniPlan General 4 2007-10-31 03:38 PM
Applescript example: exporting to a text file RobTrew OmniFocus Extras 6 2007-09-11 09:27 PM

All times are GMT -8. The time now is 10:22 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.