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

How to save additional information in script

Participant ,
Sep 03, 2023 Sep 03, 2023

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.

TOPICS
How to , Scripting
765
Translate
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

Enthusiast , Sep 03, 2023 Sep 03, 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.

Translate
LEGEND ,
Sep 03, 2023 Sep 03, 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

Translate
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
Participant ,
Sep 03, 2023 Sep 03, 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?

Translate
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 Expert ,
Sep 03, 2023 Sep 03, 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.

Translate
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
Enthusiast ,
Sep 03, 2023 Sep 03, 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.

Translate
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
Participant ,
Sep 04, 2023 Sep 04, 2023

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

Translate
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
Enthusiast ,
Sep 04, 2023 Sep 04, 2023
LATEST

Awesome!  Glad this worked for you!

Translate
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