Shoutbox

Need help - Bold characters in toast - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Need help - Bold characters in toast (/showthread.php?tid=62579)

Need help - Bold characters in toast by J3ck on 07-05-2006 at 01:15 PM

Hi all :)

I try to do a little script for MsgPlusLive! but, i've a little problem with "MsgPlus.DisplayToast".

I would like to write in the toast in bold characters...but i can't.When i put "<b></b>" in the script or they appear in my toast. :\
Have you a  little solution for me please? ^^

Thx :)


RE: Need help - Bold characters in toast by markee on 07-05-2006 at 01:21 PM

[b][/b] is what you should be using rather than <b></b>.  You have to use BBcode rather than HTML


RE: Need help - Bold characters in toast by deAd on 07-05-2006 at 01:33 PM

The [b] stuff will only be parsed in DisplayToastContact though :)


RE: Need help - Bold characters in toast by J3ck on 07-05-2006 at 01:37 PM

Thx for your reply Markee :)

I tried what you say to me but...

Example :


code:
var Message = Name + "SignOut";



it's ok but i don't have bold characters...normal ^^

But if i put [/b] as you say me...

example :

code:
var Message = [b]Name
+ "SignOut";

or

var Message = +Name + + "SignOut";

or

var Message = ''Name' + "SignOut";

or

var Message = '' + Name '' + "SignOut";



It doesn't work...
I tried all solutions that you can see...i don't understand :(
RE: Need help - Bold characters in toast by deAd on 07-05-2006 at 01:39 PM

As I said, you need to use DisplayToastContact instead of DisplayToast.


RE: Need help - Bold characters in toast by J3ck on 07-05-2006 at 01:43 PM

Thx Dead for reply :)

If i use "MsgPlusDisplayToastContact" the toast don't appear... :-S I don't understand why.

For example, if i use the script that we find in the msgplusscript documentation :

code:
function OnEvent_Signin(Email)
{
    if(Email == "your@email.com") //Change for your sign-in email
    {
        var Message = "Hello Master " + Messenger.MyName + "!";
        Message = MsgPlus.RemoveFormatCodes(Message);
        MsgPlus.DisplayToastContact("", Message);
    }
}


and if i change the line o displaytoast... for displaytoastcontact...it doesn't work. :S
RE: Need help - Bold characters in toast by deAd on 07-05-2006 at 01:58 PM

DisplayToastContact has two lines.

code:
MsgPlus.DisplayToastContact("Title","First Line","Second Line");

RE: Need help - Bold characters in toast by markee on 07-05-2006 at 02:15 PM

As deAd said, you have to use the DisplayToastContact rather than just DisplayToast like in the code below.  DisplayToastContact goes in the following order -  title,unformatted line,formatted line, sound,......

In DisplayToast it is missing the unformatted line so you won't be able to bold it.  An example of it in use is below, it is for blocking a contact an having their emil be bolded in a toast when you do :P

code:
function OnEvent_ContactBlocked(Email)
{
var Message = "<b>" + Email + "</b>"
  MsgPlus.DisplayToastContact("",Message,"",'notify.mp3')
}


NB. I wrote the bold in HTML rather than BBcode because I don't know how to turn this off :P
RE: Need help - Bold characters in toast by J3ck on 07-05-2006 at 02:25 PM

It's wonderfull!! Thank you very much to Markee and Dead, it's nice to helped me quickly :)
Now i can continue my script with "no stress" ^^
Thx again :)