different script steps based on button

Discussion created by BKamp on Feb 1, 2016
Latest reply on Feb 3, 2016 by BKamp

Hi guys!


Right now I have four buttons with accompanied scripts:

  1. print invoice
  2. print invoice + tracked hours
  3. email invoice
  4. email invoice + tracked hours


I could combine it in one script, which saves me a lot of double steps etc, if I knew how to let a script take different steps based on what button is clicked.

how can I do this?


Im trying stuff with a global variable `$$` in another script as well, but the global variable does not seem to work outside of the script is was defined, how are they supposed to work? do you need to define them in a standalone script or something?