Google Sheets Script Parameter for e.g. Button
<p><strong>Is it possible to pass parameters on a signed script?</strong></p>

<p>I have a spreadsheet and made a couple of buttons signing functions to each.</p>

<p>Sample function:</p>

<pre class="lang-js prettyprint-override"><code>function foo(){
    return "bar";
}
</code></pre>

<p>Calling this function on a cell </p>

<pre><code>=foo()
</code></pre>

<p>returns me <code>bar</code>, signing this function to a button </p>

<pre><code>foo
</code></pre>

<p>returns me nothing but of course it works. I mean the script cant return a string to an image (whats actually my button). Anyways... </p>

<p>Sample function with parameter:</p>

<pre class="lang-js prettyprint-override"><code>function foo(bar){
    return bar;
}
</code></pre>

<p>calling the script in a cell</p>

<pre class="lang-js prettyprint-override"><code>=foo('hello world')
</code></pre>

<p>returns me <code>hello world</code> as expacted</p>

<p>Signing this to my button</p>

<pre class="lang-js prettyprint-override"><code>foo('hello world') 
</code></pre>

<p>causes an error because the button cant find the script. He's searching for a function name <code>foo('hello world')</code> but <code>(...)</code> has non to do with the function.</p>

<p><strong>So how can I pass params when signing script?</strong></p>

<p>At the moment I have  26 functions (all the same, only 1 param changes) to solve this. But with passing a parameter I could do all this with 2 functions instead of 26.</p>