This function was working the way @GraysonBishop mentioned, but suddenly after 8 months of working this way no longer works. I have tried using the workarounds mentioned but none of them are working, so I am very curious what has happened. Basically the connector is useless this way, and breaks a process that I built. From testing it appears to be working about 35% of the time, using an actual selected file.