0

I have a Google Apps Script project in which I have split my functions into quite a few files in an attempt to organize them. Except, now I often can remember which file a given function is in. Is there a way to search an entire project for a function or variable?

Here's a screenshot to clarify. Highlighted in yellow are all my .gs files. Highlighted in blue is a function that I'm calling. But, oh, no! I can't remember which file (highlighted in yellow) the script for it is located in. How can do?

enter image description here

Robert M.
  • 575
  • 5
  • 17
  • 2
    Although, I'm not sure whether I could correctly understand your question, might this thread be an answer to your question? https://stackoverflow.com/q/57105711 If you want to retrieve the values except for function, how about `for (let i in this) console.log([i, this[i]])`? If this was not useful, I apologize. – Tanaike Aug 09 '23 at 03:18
  • Does this answer your question? [How can I get a list of all functions in a project?](https://stackoverflow.com/questions/57105711/how-can-i-get-a-list-of-all-functions-in-a-project) – George Aug 09 '23 at 23:42
  • No. As I said in the OP, I want to know which FILE I have placed a given function in. A flat list of all my functions does not do this. I already know the name of the function I'm looking for...I just don't know where it is. – Robert M. Aug 11 '23 at 16:46
  • @Tanaike I just want to know which of my .gs files a given function resides in. For example, say I have a function called doEverything(). I forgot which .gs file it's in. How can I search for it? – Robert M. Aug 11 '23 at 16:48
  • I edited my original question in an attempt to clarify the question. – Robert M. Aug 11 '23 at 16:53
  • A typical editor would have a little...I dunno, magnifying glass icon, the universal symbol for search. And then you could type in a keyword or symbol name and it would show you all instances of it. Even the Arduino ADE has something like that. Seems fairly basic. I guess not. – Robert M. Aug 11 '23 at 16:56
  • Thank you for replying. First I deeply apologize that my comment was not useful for your situation. From your reply, I proposed an answer. Please confirm it. In this answer, it is required to done "Preparation" section. If this is not correctly set, this script cannot be used by error. Please be careful about this. – Tanaike Aug 12 '23 at 00:37
  • @Robert M. Thank you for replying. From `Thank you for your thoughtful and thorough reply. That's not quite what I was looking for...it would be easier just to keep a Google Doc and list all my functions as I write them. It amazes me that the Google Apps Script editor lacks such a basic function as the ability to search across files. It would be trivial for them to implement.`, I understood that my answer was not useful for your situation. I think that this is due to my poor skill. From your reply, I have to delete my asnewr. I deeply apologize for my poor skill again. – Tanaike Aug 12 '23 at 11:39

0 Answers0