Problem with acv

I’m trying to save an .acv preset for the curves, but my script doesn’t work. I tried to capture the code with alchemist and then replace the “path” with a token but it doesn’t work . i noticed that the achemist code is the same for both save curves and load curves. this is my script:

async function importP(){

const fs = require(“uxp”).storage.localFileSystem;

const folderF= await fs.getFolder();

let acv=await folderF.createFile(‘curveM.acv’,{ overwrite: true } )

await acv.write("’’")

var curve=await folderF.getEntry(‘curveM.acv’)

let token=await fs.createSessionToken(curve)

const result =await batchPlay(

[

{

   "_obj": "set",

   "_target": [

      {

         "_ref": "adjustmentLayer",

         "_enum": "ordinal",

         "_value": "targetEnum"

      }

   ],

   "to": {

      "_obj": "curves",

      "presetKind": {

         "_enum": "presetKindType",

         "_value": "presetKindUserDefined"

      },

      "using": {

         "_path": token,

         "_kind": "local"

      }

   },

   "_isCommand": true,

   "_options": {

      "dialogOptions": "dontDisplay"

   }

}

],{

"synchronousExecution": true,

"modalBehavior": "fail"

});

}

I wonder if it’s actually possible to save a .acv file from a script. Not sure about that. We don’t have docs on the .acv format… at least I’m not aware of any. (However, it’s possible to import a preset and load it up in a layer.)

What you could do is save your own curve preset as a JSON file.

thanks Pierre, my panel already saves a JSON file with the curve values. I wanted to save some curves that are not generated by my panel. Alternatively is there a way to read the point values of a curve? ex. I select a curve (which I did not create with my panel) and obtain the values of the points of this curve?