Confused about synchronous internal comands

According to https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Synchronous_and_Asynchronous_functions.htm

Internal commands always run synchronously - Opus will always wait for an internal command in a function to finish before moving on to the next instruction

I have a button I'm experimenting with that calls find via cmd.RunCommand

cmd.RunCommand('Find FILTER NAME="Filter Name" RECURSE IN "G:" "H:" "I:" "J:" "K:" COLLNAME="coll://wibble"');

What I see is the script moving on while find is clearly still searching. I can see the progress dialog on the screen and yet looking at the script log I see the script has carried on.

Is something not working correctly, or am I misunderstanding how this all works?

Thanks

Internal commands always run synchronously

That's not entirely true, as there are some exceptions like the Find command. Something we need to improve on that page of the manual.

If the aim is to find files matching a filter to use in the rest of the script, doing it via the script itself may be the best thing. DOpus.FSUtil.ReadDir can get you a list of everything below a directory (recursively, if specified) and the wildcard and metadata objects can be used to do most types of filtering.

OK Leo, no problem. The manual in general is very good. Thanks.

1 Like

Find is now synchronous in Opus 13.