Page 1 of 1

Script directory

Posted: Wed Nov 18, 2015 6:01 am
by strider2000
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.

Re: Script directory

Posted: Wed Nov 18, 2015 6:14 am
by synthsin75
moho.UserAppDir() will give the path to the users custom content folder, and you can concatenate that with the specific place in the custom folder that you want to user to install the files.

Re: Script directory

Posted: Wed Nov 18, 2015 11:53 pm
by strider2000
Great. Thanks synthsin75!