Applescript Click "Go" and "Open" - dialog inside application
Try something like this:

activate application "TextEdit"
tell application "System Events"
    keystroke "o" using command down
    keystroke "g" using {shift down, command down}
    tell window 1 of process "TextEdit"
        set value of text field 1 of sheet 1 to "/usr/share/dict/connectives"
        click button 1 of sheet 1
        click button "Open"
    end tell
end tell