What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Problem] ScriptMenu Limit

[Problem] ScriptMenu Limit
Author: Message:
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. [Problem] ScriptMenu Limit
Hi,

I've made a script to copy contact's name, email, psm into the clipboard. All contacts are grouped into the script menu but i saw there's a limitation, i can't put all contact, i tried with submenu but the problem is still here.

So i ask you if there's a way to remove the limitation ?

[Image: attachment.php?pid=754664]

.jpg File Attachment: patate.JPG (24.25 KB)
This file has been downloaded 320 time(s).

This post was edited on 11-18-2006 at 12:45 AM by Huhu_Manix.
11-18-2006 12:44 AM
Profile E-Mail PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [Problem] ScriptMenu Limit
The list might get too long depending on the no of contacts. All of them won't fit on the screen so why not make a window with a ListViewControl to do th same?
11-18-2006 03:38 AM
Profile E-Mail PM Web Find Quote Report
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. RE: [Problem] ScriptMenu Limit
Because i prefer use the scriptmenu, it's more easy than open a window... ^^

But if there's really no way to show all contact on the list i'll use a window as you said. :s


Someone know why there's this limitation ? *-)
11-18-2006 11:33 AM
Profile E-Mail PM Web Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
36 / Male / –
Joined: May 2004
Status: Away
RE: [Problem] ScriptMenu Limit
Are you sure that's the max you can get?  Check out the activities launcher script I made, the menu gets far longer than that. :S
11-18-2006 11:36 AM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [Problem] ScriptMenu Limit
quote:
Originally posted by alexp2_ad
Are you sure that's the max you can get?  Check out the activities launcher script I made, the menu gets far longer than that. [Image: msn_confused.gif]
Yea you should see a Down Arrow there and should be able to scroll 8-).
11-18-2006 12:11 PM
Profile E-Mail PM Web Find Quote Report
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. RE: [Problem] ScriptMenu Limit
Yes, there's 4 buttons by submenu. When i remove 1 or 2 buttons by submenu, i can show more contacts.

When i don't use submenu, i see a down arrow, but the limitation is still here ! :@

I've seen the scriptmenu's return into the debug window and that's good, there's all contacts. ^o)


Code :
code:
function tronq(mail,lght){
    mail = MsgPlus.RemoveFormatCodes(mail);
    mail = mail.split("\"").join('\\\"');
    mail = mail.split("<").join("");
    mail = mail.split(">").join("");
    if(mail.length>lght)return mail.substring(0, lght-3)+"...";
    return mail;
}
function copy(str){
    var size = str.length*2+2;
    var GMEM_MOVEABLE = 0x2;
    var GMEM_SHARE = 0x2000;
    var GMEM_ZEROINIT = 0x40;
    var memtype = GMEM_MOVEABLE | GMEM_SHARE | GMEM_ZEROINIT;
    if (Interop.Call("User32", "OpenClipboard", 0)){
    var heap = Interop.Call("Kernel32", "GlobalAlloc", 0, size);
    var p = Interop.Call("Kernel32", "GlobalLock", heap);
    Interop.Call('Kernel32','RtlMoveMemory',p,str,size);
    Interop.Call("Kernel32", "GlobalUnlock", heap);
    if (Interop.Call("User32", "OpenClipboard", 0)){
    Interop.Call("User32", "EmptyClipboard");
    Interop.Call("User32", "SetClipboardData", 13, heap);
    Interop.Call("User32", "CloseClipboard");
    }
    }
}
function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd){
    if(MenuItemId=="me"){if(Location==2)OriginWnd.EditText_ReplaceSel(Messenger.MyEmail);else copy(Messenger.MyEmail);}
    if(MenuItemId=="me_NAME"){if(Location==2)OriginWnd.EditText_ReplaceSel(Messenger.MyName);else copy(Messenger.MyName);}
    if(MenuItemId=="me_PSM"){if(Location==2)OriginWnd.EditText_ReplaceSel(psm);else copy(Messenger.MyPersonalMessage);}
    if(MenuItemId=="me_2"){if(Location==2)OriginWnd.EditText_ReplaceSel(Messenger.MyName+" - "+Messenger.MyPersonalMessage);else copy(Messenger.MyName+" - "+Messenger.MyPersonalMessage);}
    var Contacts = Messenger.MyContacts;
    var e = new Enumerator(Contacts);
    for(; !e.atEnd(); e.moveNext()){
        var Contact = e.item();
        var mail = Contact.Email;
        var name = Contact.Name;
        var psm = Contact.PersonalMessage;
        if(MenuItemId==mail){if(Location==2)OriginWnd.EditText_ReplaceSel(mail);else copy(mail);}
        if(MenuItemId==mail+"_NAME"){if(Location==2)OriginWnd.EditText_ReplaceSel(name);else copy(name);}
        if(MenuItemId==mail+"_PSM"){if(Location==2)OriginWnd.EditText_ReplaceSel(psm);else copy(psm);}
        if(MenuItemId==mail+"_2"){if(Location==2)OriginWnd.EditText_ReplaceSel(name+" - "+psm);else copy(name+" - "+psm);}
    }
}

function OnGetScriptMenu(Location){
    var xmlMenu = new String();
    xmlMenu += '<ScriptMenu>';
    xmlMenu += '<SubMenu Label="Vous">';
    xmlMenu += '<MenuEntry Id="me">'+tronq(Messenger.MyEmail, 60)+'</MenuEntry>';
    xmlMenu += '<MenuEntry Id="me_NAME">Pseudo - '+tronq(Messenger.MyName, 60)+'</MenuEntry>';
    xmlMenu += '<MenuEntry Id="me_PSM">PSM - '+tronq(Messenger.MyPersonalMessage, 60)+'</MenuEntry>';
    xmlMenu += '<MenuEntry Id="me_2">Pseudo + PSM</MenuEntry>';
    xmlMenu += '</SubMenu>';
    var Contacts = Messenger.MyContacts;
    var e = new Enumerator(Contacts);
    for(; !e.atEnd(); e.moveNext()){
        var Contact = e.item();
        var mail = Contact.Email;
        xmlMenu += '<SubMenu Label="'+mail+'">';
        xmlMenu += '<MenuEntry Id="'+mail+'">'+tronq(mail, 60)+'</MenuEntry>';
        xmlMenu += '<MenuEntry Id="'+mail+'_NAME">Pseudo - '+tronq(Contact.Name, 60)+'</MenuEntry>';
        xmlMenu += '<MenuEntry Id="'+mail+'_PSM">PSM - '+tronq(Contact.PersonalMessage, 60)+'</MenuEntry>';
        xmlMenu += '<MenuEntry Id="'+mail+'_2">Pseudo + PSM</MenuEntry>';
        xmlMenu += '</SubMenu>';
    }
    xmlMenu += '</ScriptMenu>';
    Debug.Trace(xmlMenu);
    return xmlMenu;
}

The 'tronq()' function just limit the text to X character, remove < and > and replace " by \".

This post was edited on 11-18-2006 at 12:54 PM by Huhu_Manix.
11-18-2006 12:47 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On