quote:
Originally posted by pedro_cesar
I have this -piece- of XMl code:
code:
<Control xsi:type="EditControl" Id="pathEdit">
<Position Left="10" Top="30" Width="230"/>
</Control>
<Control xsi:type="ButtonControl" Id="StealBTN">
<Position Left="100" Top="50" Width="50"/>
<Caption>Steal</Caption>
</Control>
Can you post the rest of the XML? Did you change the Window ID? If so then you need to correct your On
WindowIdEvent_CtrlClicked()
quote:
Originally posted by pedro_cesar
And this -piece- of JScript code:
code:
function stealDP (dir_path) {
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,dir_path+Contact.Email+".png");
}
} MsgBox("Successfully Stolen!");
}
Just making your routine better
code:
function stealDP(path){
for (var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext()){
if (e.item().DisplayPicture !== ''){
Interop.Call('user32', 'CopyFileW', e.item().DisplayPicture, path + '\\' + e.item().Email + '.png', false);
}
}
}
quote:
Originally posted by pedro_cesar
How do I pass correctly what was typed in "pathEdit" to a variable so later I can use that in the StealDp function?
Make a global variable
code:
var this_is_a_global_variable;
function _this_is_a_function(){
var this_is_a_local_variable;
}