Ray, give this a shot - it's a little crude, but it correlates to the objects we discussed earlier for the CTI path you need to make sure the client side can pop this with IE also make sure it is a named browser window, and it will fire in the same window over and over as the calls come in rather then to seperate ones.
//define variables
var htmlstring,datedir,timedir,filepath,webpath,webserver,webrootpath,rootpath,head,foot,dt,tm,date_day,today,date_month,date_year,date_hr,date_min,date_sec,filepath,file,forwriting,filename,fso,callid;
//date disection for directory structure
dt = new Date();
date_month = dt.getMonth()+1;
date_day = dt.getDate();
date_year = dt.getFullYear();
date_hr = dt.getHours();
date_min = dt.getMinutes();
date_sec = dt.getSeconds();
//build paths and stuff
rootpath = "d:\\IPCCWebPop";
webrootpath = "http://server-etv2/IPCCWebPop";
datedir = date_year +'-'+ date_month +'-'+ date_day;
timedir = date_hr+':'+date_min+':'+date_sec;
//build File System Object and parameters
forwriting = 8;
fso = new ActiveXObject("Scripting.FileSystemObject");
//check to see if the dated directory exists if not create it.
filename = "%FirstInteractionID%"+'.html';
if (fso.FolderExists(rootpath + '\\' + datedir)){
filepath = rootpath + '\\' + datedir + '\\'+filename;
webpath = webrootpath + '/' + datedir + '/' + filename;
}
else
{
fso.CreateFolder(rootpath + '\\' + datedir);
filepath = rootpath + '\\' + datedir + '\\' + filename;
webpath = webrootpath + '/' + datedir + '/' + filename;
}
//create HTML
htmlstring = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE>IPCC.WEBPOP1</TITLE></HEAD><BODY BGCOLOR="8aa2f0"><FORM ACTION="">';
htmlstring +='<FIELDSET><LEGEND align="right">Call Information</LEGEND><TABLE ><TR><TD><INPUT readonly size= "40" TYPE="TEXT" NAME="strDateTime" VALUE=';
htmlstring +='"' + datedir + ' ' + timedir + '"></td></tr><TR><TD><INPUT readonly size= "40" TYPE="TEXT" NAME="strCallingNumber" VALUE=';
htmlstring +='"' + "%ANI%" + '"></td></tr><TR><TD><INPUT readonly size= "40" TYPE="TEXT" NAME="strCallingName" VALUE=';
htmlstring +='"' + "%CallName%" + '"></td></tr></TABLE></FIELDSET><FIELDSET><LEGEND align="right" color="black">Account Information</LEGEND><TABLE ><TR><TD><INPUT readonly size= "40" TYPE="TEXT" NAME="field1A" VALUE=';
htmlstring +='"' + "%Customer_Firstname%" + ' ' + "%Customer_LastName%" + '"></td></tr><TR><TD><INPUT readonly size= "40" TYPE="TEXT" NAME="field1B" VALUE=';
htmlstring +='"' + "%Customer_Account%" + '"></td></tr></TABLE></FIELDSET><FIELDSET><LEGEND align="right">Company Information</LEGEND><TABLE ><TR><TD><INPUT readonly size= "40" TYPE="TEXT" NAME="field1A" VALUE=';
htmlstring +='"' + "%Company_Name%"+ '"></td></tr><TR><TD><textarea NAME="field1C" cols="30" rows ="4">';
htmlstring +="%Company_Greeting%" + '</textarea></td></tr><TR><TD><INPUT readonly size= "40" TYPE="TEXT" NAME="Congstring" VALUE=';
htmlstring +='"' + "%ANI%" + '##' + "%CallName%" + '##' + "%Customer_Account%" + '##' + "%Customer_Firstname%" + '##' + "%Customer_LastName%" + '"' + '</TABLE></FORM></BODY></HTML>';
//open the file for writing and write html to it.
file;
if (fso.FileExists(filepath))
{
file = fs
penTextFile(filepath, forwriting, false);
file.WriteLine(htmlstring);
file.close();
}
else
{
var file = fso.CreateTextFile(filepath, true);
file.WriteLine(htmlstring);
file.close();
}
webpath