• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Create a system level .txt file

Community Beginner ,
Aug 03, 2020 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");

TOPICS
How to , Import and export , Scripting

Views

265

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
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 04, 2020 Aug 04, 2020

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");

Votes

Translate

Translate
Community Expert ,
Aug 04, 2020 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");

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

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

Copy link to clipboard

Copied

LATEST

Yes, thanks for the input. 

Votes

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
community guidelines