Both of those work for me when run from Script Editor.
However, both of them fail for me when run from a "Run AppleScript" step in an Automator workflow. ("OmniFocus got an error: Some parameter wasn't understood.")
However, both of them fail for me when run from a "Run AppleScript" step in an Automator workflow. ("OmniFocus got an error: Some parameter wasn't understood.")