PureBytes Links
Trading Reference Links
|
Here I go again, you will not believe how ignorant people can become towards understanding there software, gees... Well remember when you helped me with that script to automatically import investordata files through using the "tools menu ". Well I need a small add-on. Here follows the current working copy of the script....what I need added is the following. The daily update file get's send to the people via e-mail and in the form of a zip file. I have gotten them so far as to save the update attachment to the c:\ID folder as a zip file. I now need to add to the current script file the ability to "UNZIP" the file and then continue with the update, when finished, remove ALL files in the c:\ID folder. Also take into account that I have created the following folder: c:\programm files\ami broker\pkunzip in here lives the pkunzip.exe file and his friend pkunzip.pif which I created to automatically close the unzip screen.....
Also when the update is done, AmiBroker must run the "File + Save" command in order to save the changes ( believe it or not they forget to do this .... ;)
Please work your magic one more time ;)
Kind regards
Louw Coetzer
(South Africa)
____________________________________________________________________________________
var FileSystemObject = new ActiveXObject("Scripting.FileSystemObject");
var AmiBroker = new ActiveXObject("Broker.Application");
var ForReading = 1;
var DataFolder = "c:\\ID\\";
function RunAmiUpdate(filename)
{
AmiBroker.Import(0, filename + ".EDD", "edd.format");
AmiBroker.RefreshAll();
}
function ImportEDD(filename)
{
if( ! FileSystemObject.FolderExists( DataFolder ) )
{
WScript.echo("A data folder:\n" + DataFolder + "\ndoes not exist.\nIf yourdata are in another location please enter the path to this location\nto the 'Arguments' edit field in the Tools->Customize dialog.");
return;
}
RunAmiUpdate( DataFolder + filename );
try {
FileSystemObject.DeleteFile( DataFolder + filename + ".edd");
} catch (e) {
/* Ignore errors */
return; }
}
function UpdateToday()
{
var CurDate = new Date();
y = CurDate.getFullYear();
m = CurDate.getMonth() + 1;
d = CurDate.getDate();
filename = y + ( m < 10 ? "0" : "" ) + m + ( d < 10 ? "0" : "" ) + d;
ImportEDD( filename );
}
UpdateToday();
------=_NextPart_001_0015_01C15C94.9C6BA4E0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"><BASE
href="file://C:\Program Files\Common Files\Microsoft Shared\Stationery\">
<STYLE>BODY {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
UL {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
OL {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
DIR {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
MENU {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
DIV {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
DT {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
DD {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
ADDRESS {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
BLOCKQUOTE {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
PRE {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
BR {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
P {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
LI {
BACKGROUND-POSITION: left top; FONT-WEIGHT: normal; FONT-SIZE: 20pt; COLOR: black; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: "Perpetua MT", "Times New Roman"; BACKGROUND-COLOR: #ffffef
}
H1 {
FONT-WEIGHT: normal; FONT-SIZE: 65pt; COLOR: #660000; FONT-FAMILY: "Old English Text MT", "Times New Roman"
}
P.msoNormal {
MARGIN-TOP: 0em; FONT-WEIGHT: normal; FONT-SIZE: 20pt; MARGIN-BOTTOM: 0em;COLOR: black; FONT-FAMILY: "Perpetua MT", "Times New Roman"
}
LI.msoNormal {
MARGIN-TOP: 0em; FONT-WEIGHT: normal; FONT-SIZE: 20pt; MARGIN-BOTTOM: 0em;COLOR: black; FONT-FAMILY: "Perpetua MT", "Times New Roman"
}
</STYLE>
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY bgColor=beige background=cid:001301c15c83$d8db33c0$0100007f@xxxxx
topMargin=150>
<DIV><STRONG><FONT size=4>Dear Tomasz</FONT></STRONG></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=3>Here I go again, you will not believe how ignorant people can
become towards understanding there software, gees... Well remember when
you helped me with that script to automatically import investordata files
through using the "tools menu ". Well I need a small add-on. Here
follows the current working copy of the script....what I need added is the
following. The daily update file get's send to the people via e-mail and
in the form of a zip file. I have gotten them so far as to save the update
attachment to the c:\ID folder as a zip file. I now need to
add to the current script file the ability to "UNZIP" the file and then continue
with the update, when finished, remove <STRONG><U>ALL</U></STRONG> files inthe
c:\ID folder. Also take into account that I have created the following
folder: c:\programm files\ami
broker\pkunzip in here lives the pkunzip.exe file and
his friend pkunzip.pif which I created to automatically close the unzip
screen.....</FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=3>Also when the update is done, AmiBroker must run the "File +
Save" command in order to save the changes ( believe it or not they forget to do
this .... ;)</FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=3>Please work your magic one more time ;)</FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=3>Kind regards </FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=3>Louw Coetzer</FONT></DIV>
<DIV><FONT size=3>(South Africa)</FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT
size=1><STRONG>____________________________________________________________________________________</STRONG></FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=3><STRONG>var FileSystemObject = new
ActiveXObject("Scripting.FileSystemObject");<BR>var AmiBroker = new
ActiveXObject("Broker.Application");<BR>var ForReading = 1;<BR>var DataFolder =
"c:\\ID\\";<BR> <BR> <BR>function
RunAmiUpdate(filename)<BR>{<BR> AmiBroker.Import(0, filename + ".EDD",
"edd.format");<BR> AmiBroker.RefreshAll();<BR>}<BR> <BR>function
ImportEDD(filename)<BR>{<BR> <BR> <BR> if( !
FileSystemObject.FolderExists( DataFolder ) )<BR>
{<BR> WScript.echo("A data folder:\n" + DataFolder + "\ndoes not exist.\nIf
your data are in another location please enter the path to this location\nto the
'Arguments' edit field in the Tools->Customize
dialog.");<BR> return;<BR>
}<BR> <BR> <BR> RunAmiUpdate( DataFolder + filename
);<BR> <BR> try {<BR>
FileSystemObject.DeleteFile( DataFolder + filename +
".edd");<BR> } catch (e) {<BR> /* Ignore errors
*/<BR> return; }<BR> } </STRONG></FONT></DIV>
<DIV><FONT size=3><STRONG></STRONG></FONT> </DIV>
<DIV><FONT size=3><STRONG><BR>function UpdateToday()<BR>{<BR> var CurDate =
new Date();</STRONG></FONT></DIV>
<DIV><FONT size=3><STRONG></STRONG></FONT> </DIV>
<DIV><FONT size=3><STRONG> y =
CurDate.getFullYear();<BR> m = CurDate.getMonth() +
1;<BR> d = CurDate.getDate();<BR> <BR> <BR>
filename = y + ( m < 10 ? "0" : "" ) + m + ( d < 10 ? "0" : "" ) +
d;<BR> <BR> ImportEDD( filename
);<BR> <BR>}<BR> UpdateToday();</STRONG></FONT></DIV></BODY></HTML>
------=_NextPart_001_0015_01C15C94.9C6BA4E0--
Attachment:
Description: ""
|