Appreciate if I can get help on this little problem.
I have a folder named C:\app\folder, this folder can contain a file that have a file name in the format AAxxx.exe. In case such a file exists, I want to fetch the version and the full path of the file.
This relevance works if a file exists, but if there is no file - I get the common “Error: Singular expression refers to nonexistent object.”
if (name of it of (file whose(name of it starts with "AA" AND name of it ends with ".exe") of folder "C:\app\folder") as string) != ""
then ((version of it, pathname of it) of file whose(name of it starts with "AA" AND name of it ends with ".exe") of folder "C:\app\folder") As String
Any idea how this can be solved, the idea is that the response should be “N/A” when no matching file exists.