Making sure a networked directory is completely loaded?

I’m not sure how to ask this question.

I have a script that works to go out to a network drive, look a specific file, and if found, it copies it to my desktop. I’ve worked on various iterations of this from time to time. I previously thought when it failed that I was doing something incorrect.

On my mac studio, running Ventura, I find that if I open the containing folder just to look at it, the whole directory doesn’t load. My solution to this is to manually create an “untitled folder” then delete it. Somehow that forces my mac to load the whole directory.

First of all, why does that happen? More importantly, is there a way to script my way passed this problem? Should I be creating and deleting a folder through AS before I start my search?

Thought on this?
David K