Ok Nicholas, here is freebie for you. I use this one all the time.
Let's say you have a data base with first and last names in different fields. You could combine them in a spreadsheet if that is where they come from. But, you can easily do it in Xpression with just a little scripting. If you put this on the scene object, the first object in your scene it will take the data from DATA_first, and from DATA_last and combine them with a space between. It will then take that info, now a full text field and send it to TXT_final. The two data fields are hidden (click the eyeball) and the TXT_final is visible. When you do this it is treated like a single text field, so any horizontal squeeze of sizing is global across the entire text.
'start of script
'variables first
dim first, last, final as xptextobject
'find the objects in the scene
self.getobjectbyname ("DATA_first", first)
self.getobjectbyname ("DATA_last", last)
self.getobjectbyname ("TXT_final", final)
'combine the elements
final.text = first.text & " " & last.text
'end of script
if you copy and paste this into your xpression scene it SHOULD work. Be sure to compile the script before you run it. I'm just doing this on a laptop. You will notice some green elements. These are comments and are preceded by '.
Have fun
------------------------------
Malcolm Thorpe
TV Syndicate/Icon Fitness
------------------------------
Original Message:
Sent: 08-24-2021 04:57
From: Nicholas Cuthbert
Subject: Where can I learn to script in Xprerssion
Thanks Malcolm,
I hear what you are saying and am also one to learn better with a clear goal in mind.
My dificulty at present is more about knowing when a script may be useful to my needs. I will gnerally find solutions with all the other options Xpression has to offer and be ignorant of an easier / better solution through scripting.
I guess I should develop the reflex to ask here on the forum and see what others may think.
Anyway, thanks again for your time.
Nick
------------------------------
[Nicholas]
[Graphic Integrator]
[RTS]
[Geneva] [Switzerland]
Original Message:
Sent: 08-22-2021 13:02
From: Malcolm Thorpe
Subject: Where can I learn to script in Xprerssion
I began learning by asking questions on the forum here. I would have a particular need and other designers would offer suggestions. By digging into these scripts I could make them my own. Simple at first, then advancing. It seems more positive for me when I have an end in mind. People are very helpful on here. Good luck, and have fun.
------------------------------
Malcolm Thorpe
TV Syndicate/Icon Fitness
Original Message:
Sent: 08-20-2021 08:40
From: Nicholas Cuthbert
Subject: Where can I learn to script in Xprerssion
Thanks.
I should have mentionned she works in broadcast graphics, so it made a possible relation more plausible. :-)
Thanks for the exchange and help.
Take care
N
------------------------------
[Nicholas]
[Graphic Integrator]
[RTS]
[Geneva] [Switzerland]
Original Message:
Sent: 08-20-2021 08:28
From: Gerard de Vries
Subject: Where can I learn to script in Xprerssion
Hi Nicolas,
Yes, I would recommend a VB (or other programming language) course first. This doesn't have to be an extensive course: a beginners course will help you enough on your way. After that the videos from Ross University, example code in the Help-file and listing of objects and enumerators in the Help-file should be all you need.
Considering you side note: No Kathrine in our family. Not even if I look to more distant relatives. "de Vries" is the most used last name in The Netherlands so the chance I am family to another "de Vries" is small.
Kind regards,
------------------------------
Gerard de Vries
Solution Architect Live Graphics & Virtual Graphics
United / EMG
The Netherlands
Original Message:
Sent: 08-20-2021 07:50
From: Nicholas Cuthbert
Subject: Where can I learn to script in Xprerssion
Thank you Gerard for your kind answer.
I had taken a quick look at the help file but because I am not a developer I have found it near impossible to use, hence why I was looking for more examples and tutorials.
But maybe I am looking at this the wrong way and should take some courses in VB first.
In any case, thanks for your time.
On a side note - and I hope this is not an inaproriate question to ask - but based on your name I am wondering if you may be related to a Kathrine?
Cheers
Nicholas
------------------------------
[Nicholas]
[Graphic Integrator]
[RTS]
[Geneva] [Switzerland]
Original Message:
Sent: 08-20-2021 06:45
From: Gerard de Vries
Subject: Where can I learn to script in Xprerssion
Hi Nicolas,
Using scripting you can do almost anything and it uses the same API/SDK as you would use creating 3rd party applications using C#, VB, Delphi, etc.. If you have installed an XPression version you can find a help file (XPressionSDK.chm) in the Help-folder of the installed version listing all possible object types and enumerators. It also contains a few small examples. You can also go to "https://www.rossvideo.com/products-services/acquisition-production/cg-graphics-systems/xpression/xpression-u/" and select "Advanced". Here you will find a few videos explaining the basics.
Kind regards,
------------------------------
Gerard de Vries
Solution Architect Live Graphics & Virtual Graphics
United / EMG
The Netherlands
Original Message:
Sent: 08-20-2021 04:47
From: Nicholas Cuthbert
Subject: Where can I learn to script in Xprerssion
Hello fellow Graphic Integrators,
I would like to have a better understanding of what scripts in Xpression can achieve and when they could/should be used.
Also, I was wondering if there was a repository of scripts somewhere on this forum that I could study?
Thanks
------------------------------
Nicholas
Graphic Integrator
RTS | Geneva | Switzerland
------------------------------