Moving Info from Mail to SuperCard

I receive information from Web forms, sent to me in emails (coming in using Mail), all nicely formatted. This info is used to create new “cards” in a SuperCard 4 project (on Mac I’m an old HyperCarder). At the moment I copy and paste/drag and drop to fill the individual fields, but I imagine that AppleScript could do the job for me. Can it? If so, any pointers to good places to start looking for AppleScript instruction would be welcome!

Hi David,

Have you done a search on this sight for “Mail” yet? There are quite a few threads.
Also, try doing a search on Code Exchange and Script Builders (both on MacScripter.net). I have to confess that I am only, really, a relative new hand at Applescript (at it just over a year, and loving it!1) so when I say that I am unclear as to your exact requrements for your script, please don’t take offense, but it may be helpful for others as well if you would state those in a somewhat clearer manner (just re-phrasing your original post may do the trick).

I hope this helps.

Sincerely,

Variable as the shade

Most probably SuperCard owns a good dictionary? If so, most probably AS can do it for you. To retrieve data from Mail, you can take a look around, as VATS said, to the BBS, or the ScriptBuilders and Code Exchange sections; even, at Apple’s AppleScript Mail site, here.
Perhaps the most interesting part is formatting the data. You’ll need a bit of if-end-if, repeat-end repeat, convert text to lists and then apply the resulting to SuperCard. In the same mentioned sections you’ll find lots of source code, and lots of advices at our FAQ. Or just ask here a more detailed question, such as “how can I get the body of a message in Mail?”

Yes.

The email comes into Mail formatted, e.g.

Event name: blablabalbla event

Locatioin: blablaville

Description: all sorts of text, including returns…

etc.

I need to take the variable information (in the above, “blablabalbla event” “blablaville” and “all sorts of text, including returns…”) and place them into predefined fields in a SuperCard card (so I’d need to create a new card in SuperCard).

That’s it, basically, so I need an AppleScript that can look at the body of the mail message (in Apple’s own Mail app), recognise the “hearders” and then copy the respective text variables to their corresponding fields in SC.

[quote=“jj”]

Gracias para todos (I’m in Spain at the moment!). A good dictionary? How do I find out? Meanwhile, here in Spain I am on a slow phone link, so I shan’t do any great searching until I get back to my cable link in Belgium on Sunday, but thanks for all the pointers, which I shall then follow.

Hasta!

This might get you started…
Not sure what mail client you are using but you need to :-

set mail_txt to text of mail message then parse the text as shown below:-

set offset_1 to (offset of "Event name: in mail_txt)
set offset_2 to (offset of "Locatioin: " in mail_txt)
set Event_txt to (characters (offset_1 + 11) thru (offset_2) of medLine_txt) as text

etc…

I’ve never used SuperCard but hopefully you can

set field “Event” to event_txt

Chris

===============================

The email comes into Mail formatted, e.g.

Event name: blablabalbla event

Locatioin: blablaville

Description: all sorts of text, including returns…

etc.

I need to take the variable information (in the above, “blablabalbla event” “blablaville” and “all sorts of text, including returns…”) and place them into predefined fields in a SuperCard card (so I’d need to create a new card in SuperCard).

That’s it, basically, so I need an AppleScript that can look at the body of the mail message (in Apple’s own Mail app), recognise the “hearders” and then copy the respective text variables to their corresponding fields in SC.
[/quote]

[quote=“davidneale”]

While in Script Editor, go to the File menu and select Open Dictionary… Select SuperCard from the list (if it’s there) to see the dictionary.

Hope this helps,
Brad Bumgarner, CTA

Here’s a thread (of many) that’ll probably be of some use:

http://bbs.applescript.net/viewtopic.php?t=4528

Jon

Seems that SuperCard has no dictionary – only two things are listed, which appear pointless and certainly of no good for what I want to do.

Thanks for everyone’s help, anyway!

Back to the drawing-board (well, the copy-and-paste board, anyway)!

Even if it isn’t scriptable, it will still be beneficial to create a script that automates extractions of the email data to at least some sort of flat text file that, if you’re lucky, may be used for an import into something useful.

Jon