Force an app to run one of its menu options from a shell script?

This is a beginning of an AppleScript to do the exporting:

set filename to "test file"

tell application "NetNewsWire" to activate
tell application "System Events"
    tell process "NetNewsWire"
        click menu item "Export Subscriptions…" of menu "File" of menu bar 1
        set value of first text field of first sheet of first window to filename
        click button "Save" of first sheet of first window
    end tell
end tell

tell application "NetNewsWire" to quit

It will save the exported file with the set filename at the location which was last used to do the exporting. It will not overwrite a currently existing file, so maybe you can save it in a temporary place and move it with a separate script.

Note: My copy of NetNewsWire had the menu command "Export Subscriptions…", not "Export Feeds", but if yours is different, just change the name of the menu item on line 6.

Edit to add: You also need to have "Enable access for assistive devices" in the Universal Access System Preference Panel set to enabled for this to work.