How can I read text from file without raising the file picker

I saw this example which explains how to read from a file, however it shows the file picker to obtain a file object.

How can I read text from a file given the filename without raising the file picker?
E.g. read a file under "LocalAppData/temp/ ?
If this location is not accessible then another location which is.

You must use the file picker when the file is locatedoutside of your plugin folder. This is to respect the users privacy. You can only read the file the user allows. If they select a file or folder then from that point on you can read without prompt.

If the file is in your plugin folder then you can read it without prompt.

Check my answer on the other topic. It’s not a good practice to create several topics on basically the same question.

Wait, so do you need it for Ps or XD? Because you asked relatively the same in both sections

I must have placed on in the wrong place - I need it for PS.

I’ve changed to Ps now, but as I mentioned, it’s a very bad practice to ask same question in multiple places :man_shrugging: