Highlighted

Create a system level .txt file

Community Beginner ,
Aug 03, 2020

Copy link to clipboard

Copied

Hi,
I want to create a text file via after effects on a mac. I am using the code below but I don't know what is going wrong as I am unable to create the folder. I have enabled Write and network access inside after effects. Please help.

 

var scriptFolderPath = File($.fileName).path; //alert(scriptFolderPath)
var s = File(scriptFolderPath + "/testfile.txt");

Adobe Community Professional
Correct answer by Mathias Moehl | Adobe Community Professional

Has your user permission to write to that folder?

How to you try to create the file?

 

The statement

var s = File(scriptFolderPath + "/testfile.txt");

does not create a file yet, it will only be created once you try to write something to it:

s.open("w");

s.write("some contents for the file");

Topics

How to, Import and export, Scripting

Views

30

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

Create a system level .txt file

Community Beginner ,
Aug 03, 2020

Copy link to clipboard

Copied

Hi,
I want to create a text file via after effects on a mac. I am using the code below but I don't know what is going wrong as I am unable to create the folder. I have enabled Write and network access inside after effects. Please help.

 

var scriptFolderPath = File($.fileName).path; //alert(scriptFolderPath)
var s = File(scriptFolderPath + "/testfile.txt");

Adobe Community Professional
Correct answer by Mathias Moehl | Adobe Community Professional

Has your user permission to write to that folder?

How to you try to create the file?

 

The statement

var s = File(scriptFolderPath + "/testfile.txt");

does not create a file yet, it will only be created once you try to write something to it:

s.open("w");

s.write("some contents for the file");

Topics

How to, Import and export, Scripting

Views

31

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
Adobe Community Professional ,
Aug 04, 2020

Copy link to clipboard

Copied

Has your user permission to write to that folder?

How to you try to create the file?

 

The statement

var s = File(scriptFolderPath + "/testfile.txt");

does not create a file yet, it will only be created once you try to write something to it:

s.open("w");

s.write("some contents for the file");

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...
Community Beginner ,
Aug 11, 2020

Copy link to clipboard

Copied

Yes, thanks for the input. 

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...