Your NOT WORKING script can be simplified to:
Set error capture
Set variable - Subject
Set variable $Address = Choose ( Get ( ScriptParameter ) ; addressfield1 ; addressfield2 ; addressfield3 )
You may not need the commit because your not changing any data/records.
the trap for error code = 1 is also useless as, no matter what, the script exits.
As far as the email getting put in draft read the section
Option: Perform without dialog in the help for Send Mail
In the "Working" script, you do not set the mail subject. Therefore the email is not complete and is left open for you to edit further, adding a subject. The "not working script" does set the subject, so the mail is complete and goes directly into Drafts.
At least this seems to be a possible explanation.
Thank you for your help and suggestions. Will try the simplified version. I am using the 'With Dialog' option on both scripts but one pops up in a new Window, the other goes to Drafts.
I will try this tomorrow. Maybe even import the script that works and try this with suitable editing. A real like-for-like test.
Many thanks again.
Got it working. In the end it was a body $content variable it needed in order to popup in a new window. It did not need either a subject or an email address to do so.
Thank you for your kind suggestions, set me on the right track.
Thank you for this. Simplified things hugely.
Never used the Choose function before - having a script parameter starting from 0 is interesting...