Dear forum,
new to Macro Scheduler.
Trying to tread a path than must have been trodden before, ideally looking for an existing script that I can modify.
Need to:
1. Check each new incoming email to a specific email address
2. Scan that email for a specific line of text containing a user MachineID number, which would always be pre-fixed with the text 'MachineID = '
3. Past that machine ID number into another windows application.
4. Ensure that this only happens for each new email, not repeatedly for the same email.
Need some pointers from a more experienced MS-er out there !
Many thanks,
Louis
Grabbing text from an email and pasting into another application
Moderators: JRL, Dorian (MJT support), Phil Pendlebury
- Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Grabbing text from an email and pasting into another application
What do you have so far, in terms of code? What email client is used? Give more details!
- Dorian (MJT support)
- Automation Wizard
- Posts: 1414
- Joined: Sun Nov 03, 2002 3:19 am
Re: Grabbing text from an email and pasting into another application
RetrievePOP3 could be your best way of achieving this.
I recommend something like this :
I recommend something like this :
- Create an email filter/rule, forwarding any emails you want to process to a new email address, solely used for this purpose.
- Use RetrievePOP3 to check that email address.
- Use Let>POP3_DELETE=1 so messages are deleted after being checked.
- Use String Handling commands to extract the text you need.
- ....Once you have the text extracted you can do whatever you wish with it.
Re: Grabbing text from an email and pasting into another application
Thank you Dorian,
that's a great pointer to get me started.
One question for now, how can I ensure that RetrievePOP3 only retrieves the earliest email (in time received), rather than all emails on the mail server at that time ?
That way (I think) I can ensure that each email is dealt with individually, before deleting it, and waiting for the next one.
Many thanks,
Louis
that's a great pointer to get me started.
One question for now, how can I ensure that RetrievePOP3 only retrieves the earliest email (in time received), rather than all emails on the mail server at that time ?
That way (I think) I can ensure that each email is dealt with individually, before deleting it, and waiting for the next one.
Many thanks,
Louis
- Dorian (MJT support)
- Automation Wizard
- Posts: 1414
- Joined: Sun Nov 03, 2002 3:19 am
Re: Grabbing text from an email and pasting into another application
You can't control that. RetrievePop3 will download whatever is there, and it will either delete none of them or all of them depending on your setting. So I suggest using a test email address first, which contains emails you send to it to test your script. Once you know for sure that it's working, either allow that email address to "go live", or start processing a different email address.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Grabbing text from an email and pasting into another application
As Dorian says if it's a dedicated box you could set them to delete, so you know you're only getting new emails all the time. Otherwise you'd need to store the count somewhere. E.g. in an INI file. Then you can use that to determine which are new and which aren't (any after that count would be new).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Grabbing text from an email and pasting into another application
Thanks guys, that clarifies.
A few days work at this, and it's proving to be a useful tool.
A few days work at this, and it's proving to be a useful tool.