1

I am relatively new to the Google doc/sheets environment (I downloaded the suite about one week ago).

I have used the script editor and have had excellent results with spreadsheet functions, but when I attempt to perform functions from the Text Class such as FIND, REPLACE, LEFT I generate a REFERENCEERROR.

The autocomplete does not have these functions as I type. When I go to the spreadsheet I can use these functions in a cell and they work fine with the expected results.

It appears that part of the basic Google Service API is not available/loaded, however, I cannot find the API with Text Class in online help.

Can you please tell me which API I am missing and how to load it into the script editor? I understand how to load API calls into the script editor but I cannot find this specific API.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
  • 1
    The text reference can be found [here](https://developers.google.com/apps-script/reference/document/text) – Robin Gertenbach Oct 27 '15 at 09:28
  • Thank you. I have read the class description and I am familiar with it's function. My question is that it does not appear to be loaded in my editor and I would like to know specifically how to do that.Thank you once again. – David Kramer Oct 27 '15 at 09:50
  • Where are you writing your script, is it a document or a spreadsheet? – Robin Gertenbach Oct 27 '15 at 10:00
  • In spreadsheet editor. – David Kramer Oct 27 '15 at 13:03
  • 1
    Are you pulling the text from a Doc? Because the text element is only available in documents, not spreadsheets. – Robin Gertenbach Oct 27 '15 at 13:04
  • So there is no way to pull text class from API inSPREADSHEET editor? – David Kramer Oct 27 '15 at 13:07
  • 1
    You have to be working with a document then you can get it the same way you would get spreadsheet data even from a script within a spreadsheet. You cannot however use the text methods on a Spreadsheet. – Robin Gertenbach Oct 27 '15 at 13:22
  • Thank you for all your help. How would you parse text from spreadsheet cells with editor in spread sheet? – David Kramer Oct 27 '15 at 14:04
  • 1
    If you just want to use things like find and replace you want to use Javascripts default [regexp](https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions) and [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) methods – Robin Gertenbach Oct 27 '15 at 15:35
  • Thank you that is what I was looking for. – David Kramer Oct 27 '15 at 15:41

0 Answers0