title: How can I create a button using app script and assign a script to it?
body: <p>As per my understanding if I want to create a button in google sheets, I have to access draw and create a shape like button, then link it to the script i have as it's described in <a href="https://subscription.packtpub.com/book/web_development/9781785882517/2/ch02lvl1sec19/creating-a-clickable-button" rel="nofollow noreferrer">here</a> and in <a href="https://stackoverflow.com/questions/6876819/how-do-you-add-ui-inside-cells-in-a-google-spreadsheet-using-app-script">How do you add UI inside cells in a google spreadsheet using app script?</a></p>
  <p>I've three questions,</p>
  <ol>
  <li>Is there a way to create a button and its <code>onClick</code> function inside app script ?</li>
  <li>If I used the method above (drawing, assigning ...) is this will be accessible to others who are going to use the same script (as i'm creating an Add-on)</li>
  <li>What's is the use of <code>SpreadsheetApp.getUi().Button</code>?</li>
  </ol>