Highlighted

Make a simple name for file path

New Here ,
May 16, 2020

Copy link to clipboard

Copied

Hi everybody,  I'm new with extendscript and when i scripting have some problem. I want to make a script can apply my preset to layer but when I create file path to dropdown list. It create a long name with path.

Screen Shot 2020-05-16 at 9.31.19 PM.png

Can you help me to create a name for long file path and conect with ffx file locate in this folder?

 

 

var path1 = "Macintosh HD/Users/mac/Desktop/develope Ae/ae scripting/preset/opacity key.ffx"
var path2 = "Macintosh HD/Users/mac/Desktop/develope Ae/ae scripting/preset/opacity key 2.ffx"
var path3 = "Macintosh HD/Users/mac/Desktop/develope Ae/ae scripting/preset/opacity key 3.ffx"
var preset1 = new File (path1);
var preset2 = new File (path2);
var preset3 = new File (path3);


var mainWindow = new Window("palette", "Dr.Motion", undefined); 

var groupPreset = mainWindow.add ("group");
groupPreset.orientation = "row";
groupPreset.add ("statictext", undefined, "Preset:"); 
var myDropdown = groupPreset.add ("dropdownlist", undefined, [preset1,preset2,preset3]);

var buttonGroup = mainWindow.add ("group");
buttonGroup.add ("button", undefined, "Apply");
buttonGroup.add ("button", undefined, "Cancel");

mainWindow.show ();

Thank you for your help. Sorry for my bad english.

 
 
 
 
Adobe Community Professional
Correct answer by justintaylor | Adobe Community Professional

If you want to display the full path, you'll want to decode your URIs, so you remove %20 and all that:

File.decode(myFile)

If you just want to select from a list of the filenames, then you can get the filename with displayName:

myFile.displayName

And store that in an array to reference your full file objects. 

TOPICS
Scripting

Views

443

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Make a simple name for file path

New Here ,
May 16, 2020

Copy link to clipboard

Copied

Hi everybody,  I'm new with extendscript and when i scripting have some problem. I want to make a script can apply my preset to layer but when I create file path to dropdown list. It create a long name with path.

Screen Shot 2020-05-16 at 9.31.19 PM.png

Can you help me to create a name for long file path and conect with ffx file locate in this folder?

 

 

var path1 = "Macintosh HD/Users/mac/Desktop/develope Ae/ae scripting/preset/opacity key.ffx"
var path2 = "Macintosh HD/Users/mac/Desktop/develope Ae/ae scripting/preset/opacity key 2.ffx"
var path3 = "Macintosh HD/Users/mac/Desktop/develope Ae/ae scripting/preset/opacity key 3.ffx"
var preset1 = new File (path1);
var preset2 = new File (path2);
var preset3 = new File (path3);


var mainWindow = new Window("palette", "Dr.Motion", undefined); 

var groupPreset = mainWindow.add ("group");
groupPreset.orientation = "row";
groupPreset.add ("statictext", undefined, "Preset:"); 
var myDropdown = groupPreset.add ("dropdownlist", undefined, [preset1,preset2,preset3]);

var buttonGroup = mainWindow.add ("group");
buttonGroup.add ("button", undefined, "Apply");
buttonGroup.add ("button", undefined, "Cancel");

mainWindow.show ();

Thank you for your help. Sorry for my bad english.

 
 
 
 
Adobe Community Professional
Correct answer by justintaylor | Adobe Community Professional

If you want to display the full path, you'll want to decode your URIs, so you remove %20 and all that:

File.decode(myFile)

If you just want to select from a list of the filenames, then you can get the filename with displayName:

myFile.displayName

And store that in an array to reference your full file objects. 

TOPICS
Scripting

Views

444

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 16, 2020 0
Adobe Community Professional ,
May 18, 2020

Copy link to clipboard

Copied

If you want to display the full path, you'll want to decode your URIs, so you remove %20 and all that:

File.decode(myFile)

If you just want to select from a list of the filenames, then you can get the filename with displayName:

myFile.displayName

And store that in an array to reference your full file objects. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 18, 2020 1
New Here ,
May 23, 2020

Copy link to clipboard

Copied

Thank you for your help, can you help me how to make a preset ffx file include in jsx file without linking file in external folder?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 23, 2020 0
Adobe Community Professional ,
May 24, 2020

Copy link to clipboard

Copied

Yes you write it to a file, then encrypt the file as a binary string. Here's one way of doing it. Start a new thread if you have more questions on this since it's a new topic.

 

https://stackoverflow.com/questions/15087701/batch-convert-images-to-binary-strings

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 24, 2020 1