Skip to main content
Known Participant
June 21, 2023
Question

Javascript: get object text from CPM.js

  • June 21, 2023
  • 2 replies
  • 302 views

Hi I would like to fetch the text data from an object on any slide e.g cp.model.data.Slide5832.si[6].

I see can see some of the relevant objects properties like position etc, however the actual text data of the layer is only avaliable in CPM.js as a html string.

Does anyone know what function could be used to extract the html string from CPM.js by using the object reference in cp.model.data?

 

Would be a massive help to my project if anyone knows how to do this!

Thanks Jorgen

This topic has been closed for replies.

2 replies

Xio Cis
Participant
June 28, 2023

Hello!... I need to know the path in which I can get the CPM.js file. 
I need to change some string, because it is in English and I need it in Spanish, when I publish an HTML5 project.

Please help me!!!

Lilybiri
Legend
June 28, 2023

You find it in the published folder under assets\js.

Stagprime2687219
Legend
June 23, 2023

I will make an attempt here.

I admit I have been struggling to fully grasp what you are trying to locate but the impression I get is that you're trying to grab the text from an object on the screen - like a smart shape perhaps...?

If that is the case - you will need to know the name of the object on screen. In my example below I have a smart shape with the name of "box".

You will need to hit the canvas element of that object so add a  'c'  to the end of the object name.  so   boxc  in this case.

Then you can find the text of that object.

 

cp.model.data.boxc.accstr

 

Am I reading the request correctly?