MyChat add-ons: developing, technical questions, testing, documentation and other useful information
User avatar
Alona Kutsenko
This script exports all photos of registered users on a disk, to the folder c:\temp\photo\

All files are named according to the template "(UIN) user's full name.jpg".

Code: Select all
// ---------------------------------------
// Script created by Alexey Pikurov
// 23.02.2017 14:55:41
// ---------------------------------------
var
  sUsersList: string;
  iUIN: integer;
begin
  sUsersList := mGetUsersListByState(-2);
 
    while length(sUsersList) > 0 do begin
      iUIN := strtoint(GetNextSt(sUsersList, ','));
      mExtractUserphoto(iUIN,
                       'c:\temp\photo\',
                       '(' + inttostr(iUIN) + ') ' + mGetUserAttribute(iUIN, 'DisplayName'));
    end;
end.
User avatar
UMO
Hello

The provided example and function mExtractUserPhoto does not work in current MyChat versions (8.5-8.7)
The script ends with RunError: Script could not be loaded

How can I export profile photos of all users to disk in newest version ?

Regards,
UMO
User avatar
Alona Kutsenko
Are you talking about this script in the Help?
Can you provide information about your version of this script?
User avatar
UMO
By newest version I mean newest version of Mychat server.

I copied the script from Help and only changed the path on disk.

I also tried to export a photo from one user (only one line with mExtractUserPhoto) - the same error.
Code: Select all
begin
    mExtractUserPhoto(5, 'c:\test\',  'photo' );
end.
User avatar
Alona Kutsenko
Yes, we found the error and fixed it, thank you for the feedback! The next build (8.7.2) will be available tomorrow.