Script directory
Posted: Wed Nov 18, 2015 6:01 am
What is the best way to get the path to the script directory without going through the file open dialog?
I have a script that I want to read from a text file, but I don't want the file open dialog to come up. I know I can use absolute path for my environment, but if I want to share the script with others they'd have to tune it for their system. I'd like the file to be in a location like the same location as the menu script or in the utility directory/folder. I have seen it work with a relative path, but it seems that may be kind of lucky, because it wasn't working for a while until I set the absolute path first. So it seems like it was caching the last accessed directory.
Thanks for any help.
I have a script that I want to read from a text file, but I don't want the file open dialog to come up. I know I can use absolute path for my environment, but if I want to share the script with others they'd have to tune it for their system. I'd like the file to be in a location like the same location as the menu script or in the utility directory/folder. I have seen it work with a relative path, but it seems that may be kind of lucky, because it wasn't working for a while until I set the absolute path first. So it seems like it was caching the last accessed directory.
Thanks for any help.