ONLYOFFICE / sdkjs-plugins

The add-ons for ONLYOFFICE Document Server and ONLYOFFICE Desktop Editors.
https://www.onlyoffice.com
Apache License 2.0
136 stars 134 forks source link

get the value of focus cell #144

Closed ThanhLNP closed 3 years ago

ThanhLNP commented 3 years ago

I have an idea that when I select a cell, I will get the name and value of that cell and I can fill in a certain value in the cell I am selecting example: When I click on cell B2 I get it address "B2", and it value is "hello" image

I am using sample python code so how can I write it in file editor.html?

Thank you for reading this question

ShockwaveNN commented 3 years ago

I think you should use our macros system and take a look at GetValue method, which described here

ThanhLNP commented 3 years ago

First of all, thank you Is there any way to automatically use macros on mouse clicks? looks like this: https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_event_mouse_button

ShockwaveNN commented 3 years ago

@ThanhLNP I don't think so, as I am aware our macroses only support changing content of document

ThanhLNP commented 3 years ago

So is there no way for me to write this Api.GetSelection().GetAddress(false, false, 'xlA1', false) in file editor.html?

ShockwaveNN commented 3 years ago

That in the main purpose of your script? You tell what you want to do, but I still not understand why you want to do those steps? Maybe there is simpler solution for your taks without any scripts

ThanhLNP commented 3 years ago

I have an idea to do "text to speech" every time I click on a certain cell So maybe I will create a plugin but it cannot be automatically speech

ShockwaveNN commented 3 years ago

@askonev Could you take a look, can this be done with our plugin systems?

ShockwaveNN commented 3 years ago

@ThanhLNP Please, leave only one question by issue, so please create a new issue about that. I think your error mean something wrong with syntax of config file, like missing semicolon or something like this

askonev commented 3 years ago

Hello @ThanhLNP Similar to your case, it is implemented in thesaurus plugin. If you have questions about the implementation, please contact.

Also, some plugins receive select change events. https://api.onlyoffice.com/plugin/config You can read the description of this initOnSelectionChanged parameter

Screen record from 2021-03-02 15 58 53

ThanhLNP commented 3 years ago

thank you so much Wish you every day to grow