How Can I Control a File Open Dialogue Box?

FWIW, I script Default Folder X for this sort of thing. Works perfectly, whereas I saw some inconsistent behaviour with the native keyboard shortcut when used programmatically.