ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Vimal Kumar
Get folder path and save the path in app.settings, and change the path when required
on Nov 13, 2018 at 3:03:29 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;


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]