bogs wrote: ↑Mon Feb 25, 2019 7:57 pm
Absolute paths, absolutely!
Kinda kidding, but Klaus does have a point. The lessons I linked to were more than I do when looking for paths, except in certain circumstances. MOSTLY, they are just very thorough.
As a couple of examples, lets say I had a folder my app is in, and wanted to go one more folder relative to that one, so the path looks like ~/myApp/Data (we don't know where the folder is sitting, it could be anywhere the user has permission to put it, home, docs, etc).
Klaus would (properly) never let that situation happen, but lets say it does for whatever reason. To work out where the Data folder was, I would probably put the fileName into a variable, cause I know it is in the base folder I want, then add the relative part of the path to get to Data -
Selection_005.png
(Not shown in the picture is that tmpPath is a script local variable outside of the handlers

)
Now, something like this wouldn't work too well on OSX, certainly if the fileName your grabbing is inside the app folder, but for Win or Lin it is suitable to most purposes.
Klaus rightly pointed out specialFolders, which there are quite a few of now, and which resolve *most* issues (Richard and I recently learned of a case where they don't, as in someone changes their "Documents" folder name to something else

) so error checking no matter which way you go should be done no matter what.
Hope that helps clear it up a bit more