I’m going nuts. I know I used to have an easier way to test for the validity of a path using the “exists” keyword. Now I can’t figure it out.
I have a text box that contains a path such as “/Users/username/Desktop/.”
I want to test to see if this path exists.
Here is my current working, but seemingly overcomplicated code:
tell application "Finder"
try
POSIX file thePath as text
on error
--do something (path is not valid)
end try
end tell
I thought that I could use something like
...if exists (POSIX file thePath) then...
but I can’t figure it out. (notably, this method throws an error when the path is invalid…which is how I arrived at the previous working block of code.) Can someone give me the simplified way to test this?