void Launch_Google
{
/*
This macro launches Google (in Internet Explorer, which is assumed to be installed in its default location) from within Multi-Edit using the current line as the search criteria. Placing a colon at the end of the line, will execute an "exact phrase" search.
The current line syntax should like something like the following:
[Either]
about Civil War
[or]
about Civil War:
- Jonathan
*/
str str_URL;
str str_Command_Line = "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE";
str_URL = "www.google.com/search?as_dt=i";
str Lookup_String = Get_Line;
If (XPos(char(58), Lookup_String, 1)) // Colon is present.
{
int int_Position_Of_Colon = XPos(char(58), Lookup_String, 1);
str str_Exact_Phrase = str_del(Lookup_String, int_Position_Of_Colon, 199);
str_URL += "&as_epq=" + str_Exact_Phrase;
}
else //No colon is present.
{
str_URL += "&as_q=" + Lookup_String;
}
str_URL += "&as_eq=";
str_URL += "&as_filetype=";
str_URL += "&as_ft=i";
str_URL += "&as_occt=any";
str_URL += "&as_oq=";
str_URL += "&as_qdr=all";
str_URL += "&as_sitesearch=";
str_URL += "&btnG=Google+Search";
str_URL += "&hl=en";
str_URL += "&ie=UTF-8";
str_URL += "&lr=";
str_URL += "&num=100";
str_URL += "&oe=UTF-8";
str_URL += "&safe=images";
make_message('Running Google.');
str str_Command_Portion = "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE";
str_Command_Portion = char(34) + str_Command_Portion + char(34);
ExecProg( str_Command_Portion + " " + str_URL,
Get_Environment("TEMP"),
Get_Environment("TEMP") + '\\temp_out.txt',
Get_Environment("TEMP") + '\\temp_err.txt',
_EP_FLAGS_DONTWAIT);
}