3 Replies Latest reply on Apr 8, 2010 3:40 PM by MarkHolbrook

    Scripts - Prompting for things...



      Scripts - Prompting for things...


      I am beginning to understand scripts pretty well.  One of the things I have to do monthly is to select a particular group of people from the database and send them an email with an attachment that is different every month.


      I have not figured out a way to have the "Send Mail" script item ask me for the attachment when the script is run.  Is there anyway?   Or is it best to simply edit the script before I run it each time?

        • 1. Re: Scripts - Prompting for things...

          I am not sure if this may be the solution you are looking for, but you can use a variable in the attachment section of your script.  The variable can be global to the file or local to the script (difference between $$ and $), though if you do use a global variable, be careful when using it with other scripts.


          As an example of what the script may look like :

          Set Variable [$attachment; Value: Get (DesktopPath) & "attachment.pdf"]

          Send Mail [Send via E-mail Client; To : Email::Recipient; Subject : "Attachment"; Message : Email::Body; "$attachment"]


          A custom dialog can be used to set the variable instead, though you may need to use some other method if you're looking for something like File -> Open in terms of a UI interface such as in conjunction with a plugin.


          I hope this helps.

          • 2. Re: Scripts - Prompting for things...

            You could just clear the "no dialog" option in the send mail script. Then you can attach the file before sending the email and continuing your script.

            • 3. Re: Scripts - Prompting for things...

              Gosh guys... you are all making me feel bad for being so stupid... I didn't try clearing the dialog checkbox... good idea... and the custom dialog... yup...


              Ok off to feel more stupid!  Thanks!