Skip to main content
YuK1_Works
Inspiring
September 3, 2023
Answered

How to save additional information in script

  • September 3, 2023
  • 3 replies
  • 725 views

I am writing a jsx script.
I would like to save what is written in edit text, etc., to a project file.
Is there a better way to do this?
I am having trouble with "app.settings.saveSetting" because it saves to preferences, so I can't have different data for each project file.

This topic has been closed for replies.
Correct answer Arie Stavchansky

You need to use the project file's XMP packets.  

You write data to the XMP of the project file and it sticks with it wherever it goes.  Once written, there is no known way to delete XMP data unless you write over it with an empty string.

3 replies

Arie StavchanskyCorrect answer
Legend
September 3, 2023

You need to use the project file's XMP packets.  

You write data to the XMP of the project file and it sticks with it wherever it goes.  Once written, there is no known way to delete XMP data unless you write over it with an empty string.

YuK1_Works
Inspiring
September 4, 2023

Thank you!
I was able to store any information using "app.project.xmpPacket".

Legend
September 4, 2023

Awesome!  Glad this worked for you!

Dan Ebberts
Community Expert
Community Expert
September 3, 2023

How much text are you talking about? You can add a comment (up to 15,999 bytes long) to each item in the project panel. Or, I guess you could create a special "Settings" comp, with a text layer that has your settings saved as a JSON object in the source text.

Mylenium
Legend
September 3, 2023

You can simply create a new file of whatever type you choose using newFile() and all that jazz. Again, refer to the Scripting Guide.

 

Mylenium

YuK1_Works
Inspiring
September 3, 2023

Thanks.
But it is not the way I wanted it.
I don't want to add more files.
Is there any way to add more information to the aep file?