Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Get folder path and save the path in app.settings, and change the path when required

  • Get folder path and save the path in app.settings, and change the path when required

    Posted by Nathaniel Logan on November 13, 2018 at 3:03 pm

    I need a small help on an After effects CEP panel script that I’m working on.

    What I’m trying to achieve is,
    1. If settings does not have a path – prompt user to select a folder. If path exists in setting:
    1.1. Check if its a valid path (if path exists). If it does, continue as normal.
    1.2. If path does not exist – prompt user to select a folder and save it to settings.
    2. Create another button in UI to change the path.

    Attaching the Link to my project files:
    https://drive.google.com/open?id=1TV40yER5wE3dIglGgSBNkccMlOpg0n69

    Much appreciated your time and your help.

    function getProjectFolder(){
    var targetFolder = Folder.selectDialog("Import Files From Folder");

    if (targetFolder){
    app.settings.saveSetting("Test Settings","Project Path",targetFolder.path + "/" + targetFolder.name);
    }
    try{
    var saveFolder = File(app.settings.getSetting("Test Settings","Project Path"));
    }
    catch (error){
    }

    return saveFolder;
    }
    var myProjectFolder = getProjectFolder();
    var path = myProjectFolder.path + "/" + myProjectFolder.name;

    Nathaniel Logan replied 7 years, 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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