问题
Is it possible to get the selected text in a cell as shown below. I think the answer is no and I can't find any commands related to selections of this type in Google Apps Script for spreadsheets.
We can select ranges of cells but I can't find any Google Apps Script commands that deal with selections within the cell even though it is possible to make these selections via menu commands and even make changes like text style and text color to partial selections of cell text.
It is interesting to note however that it is possible to capture a partial selection of text in a table cell in Google Docs with Google Apps Script for Google Docs with the following command:
DocumentApp.getActiveDocument().getSelection()
Here's an example of such a selection in the following image.
So I'm just curious if anyone can provide me with a link in the documentation that can shine some light on this question. Thanks
来源:https://stackoverflow.com/questions/45538378/is-it-possible-to-capture-the-selected-portion-of-text-within-a-spreadsheet-cell