ScriptSpot

Forum topic · General Scripting

Placing a String into a message - How to?!

By JokerMartini · 2009-11-06

Description

I'm creating a script that displays a message in the viewport. However in the message I want it to display the poly count of the selected object/s.
In order to do that I need to play a string between quotes. But when I do that it disregards the string as if it were text.
How do I bypass or fix this?
Thanks John

This is the main part of the script

base_name = ("Selection = " + c as string + " Tris and " + v as string + " Verts")

message = screenMessage()

message.display "base_name" time:5000 vertical:#top horizontal:#center textColor:[255,255,0] updatePosition:true showBox:false

Comments (1)

Marco Brunetta · 2009-11-07

In order to have quotes in a string you can use \" instead of ".

So if you want the string to be: Mary had a little "lamb" you can input "Mary had a little \"lamb\"".