Detect when IDE Script OpenFile has completed

I wish to use IDE Script to automate the building of a Xojo project in the following way:

OpenFile"...." result=BuildApp(....)

The problem is that OpenFile returns immediately whilst the project opens slowly in the background.

So BuildApp fails because the project has not yet finished opening.

I need a robust way to determine when OpenFile has completed.

How can this be achieved?

How do you execute your script? This works fine for me and builds 3 apps:

[code]dim basePath as string
basePath = “/Users/etc.”

'scheduler
openfile(basePath + “code\ current/max\ scheduler.rbp”)
Call BuildApp(7)
DoCommand(“CloseWindow”)[/code]

[quote=337698:@Thomas Sanham]I wish to use IDE Script to automate the building of a Xojo project in the following way:

OpenFile"...." result=BuildApp(....)

The problem is that OpenFile returns immediately whilst the project opens slowly in the background.

So BuildApp fails because the project has not yet finished opening.

I need a robust way to determine when OpenFile has completed.

How can this be achieved?[/quote]
Uh, it shouldn’t. We use OpenFile in our own build scripts for the IDE and it takes about 45 seconds to open that project. I’ve never seen it do what you’re describing.

Could you file a bug report with a video capture of your screen so we can see it?

Thank you for the responses.

Further investigation reveals Xojo is working correctly as expected, and there was a mistaken assumption in my original question.

My apologies, and please disregard!