How to Click the Cancel button in a dialog

Can someone help me with a script that will work in 10.2 (and older?) and 10.3?

We would like to automatically open a catalog for the end user. I’ve got applescript to launch the program, then launch the file from the CD however the program by default opens a “Open” dialog. All I want to do is cancel this dialog. Three books and several hours on google have not netted any results. Any help would be appreciated.

this is what I wrote:

tell application “Portfolio 6.1 Browser”
activate
open file “America:media:america.fdb”
tell application “System Events”
tell process “Portfolio 6.1 Browser”
keystroke “.” using {command down}
delay 1
end tell
end tell
end tell

This works great in 10.3 but not in 10.2…

Any suggestions?

TIA

Raffi

Hi,

I don’t think the command “.” will work because it causes an error and the application quits. But, if you want, you can try doing the command “.” keystroke before opening the app, but this should quit the script app.

You might try using the ‘launch’ command before the ‘activate’. This might bypass the initialization process of the app.

gl,