Forum Replies Created

  • Someone helped me on another place, so found it!
    Big thanks to Adam Plouff (founder of battleaxe.co, answered me on his Discord server).

    In his words “The script doesn’t understand relative path notation. So you want to get the path of the script, go up a folder then to the ffx file”

    Here’s the working code snippet:

    // Apply the effects from the .ffx file to the map layer
    var filePath = File(File($.fileName).parent.fullName + "/PXDMAP.ffx")
    if (filePath.exists) {
        mapLayer.applyPreset(filePath);
    } else {
        alert('PXDMAP.ffx is missing')
    }

    This also displays an error message if the file isn’t found.

    If anyone faces this problem, just did research and to go back folders (ie. this script is in the ScriptUI Panels folder and I want to reference a script from the Presets folder, located two folders above), you do

    ./../../Presets/PXDMAP.ffx

    Instead of

    /PXDMAP.ffx

    Hopefully this helps someone else too in the future!

  • Oh wow thank you so much Dan! Will browse your blog even more now when I’m looking for help from now on. Thank you so much. ❤

  • Hi Kurisuta! I’ve been trying to understand your explanation for 3 days now but can’t make it work. Would you mind sharing a project file or giving ampler explanation please? Thank you!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy