Hi Vaun,
You may want to experiment with an embedded web page in the script. You could load one that uses the implicit oauth grant and provides these controls via the API. I don't know if it would work, but it might be your best best.
I don't think what you want to do would be possible in a script alone.
Thanks,
------------------------------
Daniel McLeod
Qsect LLC
------------------------------