How to call a Shader Preset from within a running script?

Hi all... I have a script that I am working on where I want it to get the image map from one property (I was able to do this), then invoke a saved shader preset, then apply that found map to a property after the preset has been applied. How do I word the script to call that preset, then come back and continue running the script to the end?
I know how to get the found map applied to other properties, I just don't know how to get the shader preset to run in the middle of a running script.
Post edited by Slosh on
Comments
I have done this before, a long time ago, and then I encrypted my script. I don't have an unencrypted (dsa) copy of the script, and I can't remember how I did it. I also don't know how to convert my dse back to a dsa (if that was even a possibility)
The script will do this without needing to stop and restart, I would imagine you used the Cotent Manager DzContentMgr with this http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/contentmgr_dz#a_1a73a08387feb791dd038d0a2030b6cc9a
I keep getting an error. I don't think I am using the right syntax, or I am missing another element.
openFile("/Shader%20Presets/SloshWerks/ColorWerksX/Blend%201/Scripts/ApplyFirst.duf", true);
is what I have
The crux is, I am trying to load my custom shader onto a 3delight material and transfer the Opacity Strength maps to Cutout Opacity
I think you have to use one of the getAbsolutePath(s), rather than giving it a relative path - however it's been a while since I did anything and that may be wrong. Remember that people installing via Connect, if this is for the store, may have a different relative path - ContentManager should handle that fine if you go through it.
Thanks for trying to help. I gave up LOL. I tried with relative path and with absolute path. I just couldn't do it and I don't have the patience right now
Rob has (added, I think) a sample covering this http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/file_find/start