File Paths Not Working, Why?

File Paths Not Working, Why?

So, this (hopefully the script shows) is the critical part of a larger script part where I set a path variable, and open a file, read it into a variable and then use it. Except the file is coming up "not found" because the path isn't "complete" (no good)--except the file is there. This IS the path to that file. When I set this path from the Preferences:Variables interface, it works perfectly, but I can't count on that because more than one function uses this variable. I never know what the value is going to be. I HAVE to set it on the fly. I've seen examples done exactly this way. They WORK. But it doesn't work for me. I've tried with single quotes, with double quotes, with no quotes. I'm stumped. What am I doing wrong?

Apologies for my first try at posting this. I didn't get the image and am new at this...


I see two problems with your path:

  1. The path is for a folder, not a file. If you want to read a file, then you must include the file name.
  2. You enclose the path in single quotes. Don't use quotes of any kind.

This works for me:

1 Like

Thank you. I figure out #1 exactly 30 seconds after I posted this.

And felt like an idiot.

Why is it posting something like this to a forum and exposing my idiocy to the whole universe causes me to find the bug that has been dogging me for days?

I don’t know, but it happens to me regularly.

Although recently, the process of typing out a question has helped me solve the problem before I post the question. Don’t know why that’s started happening for me, but I hope it rubs off on you too. It feels a lot better than exposing my idiocy to all the world, as you say. :smile: