Wait to pass data from find?

I am interested in making a script to perform a find and return the result so that another application can read it. I have read some posts that will be very helpful.

Script to access list of File Collections
Iterating through find results

One key thing I read in the forum is that the find will happen asynchronously. So, I guess that means the following steps must be told to wait. This is part I am not sure about. Or I should say I do not know what to do.

Via a *.dcf created by another application, I want to pass a string to Directory Opus to Find. I already have that part working. Once that is complete (results found), I want the result to be passed back to the application. I know how to do this via a text file output by a script. However, I need the passing via text file to wait for the Directory Opus search to complete.

The key part I want help with is how Directory Opus will do the find and then output the data in the proper order and timing.

How can you tell Directory Opus to wait for a find in a script? Or if there is a better way to get/wait for the result, please share it. Thanks for any help.

At the moment, the best way is to avoid using Find and instead find the files via scripting, which has access to (most of) the same things Find uses, as well a helper for enumerating directories recursively.

I think we have plans to make Find synchronous in the future, which will simplify things a bit. Although scripting will still often be a cleaner way to do a lot of things, since it avoids having to create a temporary collection just to store results that get turned into something else for the next step.

I understand, I thought the only way to find files in a script is add the Find command to the script. I am sure I can handle it. However, I do not see any way to search for files via the Scripting Reference. Could you or anybody else point me in the right direction. Thanks

The default script has an example of how to list all folders under C:\. Start there. What you do to filter the list will depend on what you want to filter on.

Wow... way to much power... :joy:

I will share my script when finished.

Thanks so much!