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

Pass objects to CEP context

Participant ,
Apr 17, 2025 Apr 17, 2025

I am building cep extension and I was wondering if it is possible to pass from extendscript context object to CEP context and then pass it back to extendscript context? Eg:
extendscript [object TrackItem] -> CEP (here some operations happends with the callback data, but not with the object and its properties) -> extendscript [object TrackItem]

currently I am passing along needed data the object:
{

startTime: clip.start.seconds 
parentTrack: { trackType: "video", id: clip.parentTrackIndex },
}

using this object I am looping thought parent track and I am getting the clip object by start time. It works
but I am looking for ways to optimise the workflow (I cannot use indices due to some changes that happen on the timeline during the script run) 

maybe stringifing the object via JSON and parsing it back? 

p.s I am using both vanilla CEP and react bolt-cep

Thank you
TOPICS
SDK
129
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

Adobe Employee , Apr 17, 2025 Apr 17, 2025

I was wondering if it is possible to pass from extendscript context object to CEP context and then
> pass it back to extendscript context?


Anything passed between JavaScript and ExtendScript has to be flatted to a string, to make it across the boundary. 

>maybe stringifing the object via JSON and parsing it back?

Yep.

Translate
Adobe Employee ,
Apr 17, 2025 Apr 17, 2025

I was wondering if it is possible to pass from extendscript context object to CEP context and then
> pass it back to extendscript context?


Anything passed between JavaScript and ExtendScript has to be flatted to a string, to make it across the boundary. 

>maybe stringifing the object via JSON and parsing it back?

Yep.

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 ,
Apr 21, 2025 Apr 21, 2025

I have tried using JSON to send clip object back to cep panel and from there managed to recieve it as [object Object] with the readonly properties (no methods)

Screenshot 2025-04-21 at 2.37.14 PM.png
how can i convert it back to [object TrackItem]?

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
Adobe Employee ,
Apr 21, 2025 Apr 21, 2025
LATEST

I'm not sure you can; if you're trying to re-instantiate a trackItem from a bunch of JSON passed in from JavaScript, there's no guarantee that there will still be a corresponding trackItem available. 

Recommendation: Work with ExtendScript objects, within ExtendScript.

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