I'm trying to open a specific folder for the library, but I'm missing something.
Aeon Soul
Posts: 149
Hi everyone,
so I would like to open a specific folder from the library. It doesn't seem a big deal, but I can't find a way.
I should also say, my scripting knowledge is basically zero.
I've googled and downloaded this script: https://docs.daz3d.com/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/specific_ui/create_asset_links/start and put my relative path inside the getRelativeFilePath parenthesis, but nothing works. Not with slashes, nor with quotation marks, or a combination or the two. It keeps opening the main directory no matter what.
I would like it to open a specific folder so that people can access those files in 1 click: \Runtime\Textures\aeonsoul\Love2\Smartphone\CreateYourOwn
Hi everyone,

Comments
Runtime is a hidden folder iin the Content Library pane, like data, so you cannot show it. Or are you wanting to open it in an OS browser?
I want to open it in the OS, so that people can instantly find / open the files rather than have to navigate to them manually.
https://docs.daz3d.com/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/file_find/start should help in getting an absolute path from the relative path, then https://docs.daz3d.com/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/general_ui/display_document_dynamic/start shows how to get the OS to open something (in ths case a readme file rather than a folder, but sending a path should trigger it to open a folder).
Yup, I've done that to open folders under General (which usually contain non-Daz Studio files, like mp4, pdf, plain image files, etc.). It will open a file browser outside of Studio.
and the second script does take a relative path, so you can ignore my comment about starting with the first.
Thanks for the help, I couldn't wrap my head around it, but at least I tried :D
I have the following scheme working:
var sDazStudioPath = App.getHomePath();
var sFullPath = sDazStudioPath + "/Runtime/Textures/aeonsoul/Love2/Smartphone/CreateYourOwn";
App.showURL( "file:///" + sFullPath );
Please note that when using backslashes in the path to the folder, Script IDE gives an error, despite the fact that I am using Windows 10! Also, if this folder does not exist, the script runs, but the file browser does not open.
backslash is a reserved character - it is used to mark the enxt character as a special symbol (e.g. \n for return or \t for tab) so either use / (which is cross-platform, you can use it on Windows) or use \\ which inserts a single \ (it tells the interpreter that the next character is a special symbol, and that the special symbol is \).
Note that that code lacks any error checking, and will fail if the product is isntalled through Daz Connect (ublike the sample script, whch does work - I have used it to replace non-functonal readme scripts).