send script via mail

Hi all !!!

I’ve created a list using “choose from list” and i would like to send it via mail. Choice of recipient would automatically sent back to me at my mail address.

Thanks for your help !


Hello, Pascal,

First of all, you’re choosing from the list of what?

Second, are you choosing one or multiple objects?

Third, do I understand correctly that you want to mail a copy of each of the selected to yourself?

Fourth and most important, could you give us an example of your script for better clarification?

Model: MacBook Pro
AppleScript: 2.7
Browser: Safari 605.1.15
Operating System: macOS 10.13

Hello scrutinizer82 !!!

choose from list {"Sole panée", "Filet de porc", "Pâté de saumon", "stew", "ravioli avec sauce rosée", "50 singles de krfaft"} with prompt "Que veux-tu manger pour souper ma chérie?"

I’d like to send an email that would present this dialog and the choice would be returned to me automatically via email.

Just one choice.

Actually, i’m reading about how to manage email using applescript.

Thanks for your help !

Actually what you want is highly sophisticated programming for which AppleScript is not sufficient because the task would involve quite a bit of serious programming and hence, different strategy which would demand very qualified approach. The main obstacle is that each user can have AppleScript scripts on his or her machine and run those on his/her behalf: these scripts can be written so that incoming messages trigger AppleScript events (something akin to creating Mail rules) but there’s no way to ensure for Mail to interact with another user in the way that you outlined: using Standard Additions dialogs that (1) are raised within a Mail message (2) can send back entered values over IMAP/POP protocols.
There the AppleScript-ObjC hybrid language exists however I cannot tell if that’s possible because I don’t use it.
There’s, also, a number of 3rd party paid AppleScript Utilities that expand AppleScript but I’m not aware of any of them capable of the described-above: they provide more fine tools to create dialogs with more branchy set of UI elements populating the dialog, however I don’t know whether they are as advanced as to be able to initiate remote execution within Mail. Perhaps you should turn your attention to very specialized database management programs such as FileMaker Pro or the like but again, I cannot guarantee this is the solution.

It is not so difficult to return selected item information via email.

But it looks like a kind of Virus. Gmail does not relay a message with archived executable attached.

That’s what I meant when I said that you can run AppleScript via Mail only by passing an attachment (often zipped): there’s no a conventional way to eliminate that step; defeats the whole point of automation.
It makes more sense to create a form using Adobe Acrobat, and embed it in a site or attach to a Mail message if you know how.

Thanks for the reply !!!

So what would be the minimal intervention of the recipient to send me back his/her choice ?