Registering and logging in removes this ad.
Registering and logging in removes this ad.
Creating e-mail body, e. g. e-mail address and salutation with only one spoken variable
Submitted by udo on Thu, 01/03/2008 - 10:34.
Hello mdl and all others,
When I write an e-mail to somebody, I have in the simplest scenario two variable parts:
* the e-mail address, e. g. x...@whereever.com
* the salutation, e. g. Hello Surname_XYZ,
I just want to start the Vocola-Macro with saying e. g.
"E-Mail new mdl"
which should create two texts, e. g.
m...@whereever.com
Hello Surname_mdl,
Is this possible with Vocola?
Thanks and greetings
Udo



"create message to xyz"
I use the following to create messages to known addresses while working in Outlook:
subject() := {Alt+u} ;
bccMe() := subject() {Shift+Tab_1} per.haglund@... {Enter} ;
create message to <_anything> = {Ctrl+shift+m} Wait(200) subject() {Shift+Tab_3} $1 {Tab} bccMe() {Tab_2} "Hi," {Enter_4} "Kind regards,"{Enter_2} "Per" {Up_4} ;
As you can see it only works with one variable, but you can extend it by separating them with a fixed word and referring to them as $1 and $2:
create message to <_anything> at <_anything> = ...
I'm not sure how easy it will be for you to get the e-mail address correct every time, perhaps it's better to create the message with the salutation with one macro, and position the cursor in the to: field
Multiple values per list entry
Yes, this is possible.
I haven't tested the following code, but something similar to it should work:
<person> := ( Mark = Mark,mark.someone@gmail.com |
Udo = Udo,udo.whatever@fred.org );
include "string.vch";
email <person> = "To: " Split($1, "," , 1) {enter}
"Hi " Split($1, ",", 0) "!" {enter};
string.vch comes with Vocola 2.6; I reproduce the relevant function below:
- Mark
## Split(string,separator,index): Splits $string by occurrences
# of $separator (itself a string) into a list of substrings then
# returns the $index-th(*) substring.
#
# Example splits:
# "ab,cd,,ef" by "," yields "ab", "cd", "", "ef"
# "ab//cd/e//f" by "//" yields "ab", "cd/e", "f"
# "" by "," yields ""
#
# (*) - 0 denotes the first string, 1 denotes the second string, ...
# -1 denotes the last string, -2 denotes the second to last string, ...
#
# Behavior for index values that describe nonexistent strings is undefined.
#
Split(string, separator, index) :=
Eval('str($string).split(str($separator))[int($index)]');
Hello Mark, that's the "most
Hello Mark,
that's the "most valued hint" I have ever gotten here! Many thanks for it. Wasn't aware of the *.vch up to now.
Any additional hints concerning that file type? Don't have Vocola 2.6, so many thanks for mentioning Split() here.
Just added that method as split.vch.
The only problem was that "..." must be used:
<person> := ( Mark = "Mark,mark.someone@gmail.com" |Udo = "Udo,udo.whatever@fred.org" );
Really unbelievable possibilities now!
Should be mentioned in the Vocola documentation.
Many thanks and greetings
Udo