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.
Script directory
Moderators: Víctor Paredes, Belgarath, slowtiger
- strider2000
- Posts: 506
- Joined: Sat Mar 07, 2015 5:14 pm
- Contact:
- synthsin75
- Posts: 9972
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Script directory
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.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- strider2000
- Posts: 506
- Joined: Sat Mar 07, 2015 5:14 pm
- Contact:
Re: Script directory
Great. Thanks synthsin75!