I have this XML code (this is just part of it):
code:
<Control xsi:type="StaticControl" Id="LblTop">
<Position Left="60" Top="10" Width="150"/>
<Caption>Steal ALL Contacts Info</Caption>
</Control>
<Control xsi:type="CheckBoxControl" Id="DPsCBox">
<Position Left="10" Top="25" Width="50"/>
<Caption>Steal Dps</Caption>
</Control>
<Control xsi:type="ButtonControl" Id="StealBTN">
<Position Left="65" Top="40" Width="50"/>
<Caption>&Steal</Caption>
</Control>
how do I make StealBTN realize function "stealDP" only if "DPsCBox" is activated?
I have this code which does not work:
code:
function stealDP () {
for(var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext())
{ var Contact = e.item();
if (Contact.DisplayPicture != "") {
var oFSO = new ActiveXObject("Scripting.FileSystemObject");
oFSO.CopyFile(Contact.DisplayPicture,MsgPlus.ScriptFilesPath+"\\DPs\\"+Contact.Email+".png");
}
} MsgBox("Successfully Stolen!");
}
function OnWndTestEvent_CtrlClicked(Wnd, ControlId) {
if(ControlId == "StealBTN" && (Config['DPsCBox'] == "on") ) { stealDP () }
}
and I KNOW the problem is when it checks for the DPsCbox (at: && (Config['DPsCBox'] == "on") ) 'cuz if I erase that part it works just fine.