title: How know difference between execution by action menu and debug?
body: <p>I have google spreadsheet with some custom menu.</p>
  
  <p>How my script can know when is invoke it because the user clic on custom menu and when it execute by user use script editor for debugging ?</p>
  
  <p>How can i know difference between both instances ?</p>
  
  <p>i was try with something like :</p>
  
  <pre><code>SpreadsheetApp.getUi() === undefined
  </code></pre>
  
  <p>but i want try something else</p>
  
  <p>The main goal, is let user with editor rights can use custom menus but when they want debug with the Script Editor the code of my Lybrary, block this action.</p>
  
  <p>I'am working over a Library, and i want avoid that users can read the code of Library. I know that Addon can help in this way. But i want work with Libraries</p>
  
  <hr>
  
  <p>FINAL ANSWER</p>
  
  <p>There is not way to find a diffetence.
  For the main goal, we need coding ADDONS 
  <a href="https://developers.google.com/apps-script/add-ons/" rel="nofollow noreferrer">https://developers.google.com/apps-script/add-ons/</a></p>