I have two problems with my latest project of reading fields from an XML file and using that text to change the focus of my Xpression Studio sequence.
I need to be able to search my XML fields for a particular rundown.
My XML:
Based on a successful macro for another project, I think… runningorders\ro<slug=@runningorder@>\story\headline …should work, but it doesn’t.
Once I get the text, I need to SetFocus in my sequence group…I cobbled this script together and it will compile, but doesn’t change the focus.
dim Sequence as xpSequencer
dim ShotBox as xpTakeItemGroup
dim StaticID as xpTextObject
Self.GetObjectByName(“StaticID”,StaticID)
Sequence.GetGroupByName(“ShotBox”,ShotBox)
Sequence.SetFocus(“StaticID.text”)
Does anybody have an idea what I am doing wrong…well, other than habitually biting off more than I can chew?
Thanks,
James.
Hi James.
On the second question.
If I understood correctly, you need to select TakeItem according to the text in the text object?
Here is an example script
Dim StaticID As xpTextObject
self.GetObjectByName("StaticID", StaticID)
Dim Sequence As xpSequencer = engine.Sequencer
Dim item As xpTakeItem
Sequence.GetTakeItemByID(CInt(StaticID.Text), item)
item.SetFocus()
Hi James,
I don’t know what value you are looking for in the Story rows and how you choose which row you want to read the value from.
But if you want to find a value of the “Headline” field in the XML data, then a condition (e.g. <status=PLAY> or sequence number e.g. <2>) must be added to the story part or otherwise you always get values of the first story line. And the name of the field to search for should be in Datalinq’s Row field.
That is, put in the Column field:
ro\story<status=PLAY> or ro<slug=@runningorder@>\story<status=PLAY>
and in the Row field:
Headline
Roman,
This looked like it should work, but CInt(StaticID.Text) not being in quotes locked up Xpression…so I tried to assign it to ID, but it still wouldn’t set focus.
dim StaticID as xpTextObject
dim Sequence as xpSequencer = engine.Sequencer
dim item as xpTakeItem
dim ID as integer
Self.GetObjectByName(“StaticID”,StaticID)
ID=CInt(StaticID.text)
Sequence.GetTakeItemByID(“ID”, item)
item.SetFocus()
Any other ideas what might be wrong?
Thanks,
James.
Juha,
My XML always has the story I need at the top of its running order.
The issue is that there may be several running orders—I’ve tried every combination of macro I can think of with no luck.
column: ro\story
row: headline
works fine, but as soon as I try to figure out the macro it doesn’t work.
Thanks,
James.
Hi James
Something is wrong.
Sequence.GetTakeItemByID(“ID”, item) in this case means that the ID is a string and is not used in GetTakeItemByID. ID must be without quotes.
In which an event engine do you set this script? The OnOnline engine does not work with this.
Install this script in an SceneDirector script let’s say on frame 10 and everything works.
Dim StaticID As xpTextObject
scene.GetObjectByName("StaticID", StaticID)
Dim Sequence As xpSequencer = engine.Sequencer
Dim iteam As xpTakeItem
Sequence.GetTakeItemByID(CInt(StaticID.Text), iteam)
iteam.SetFocus()
Roman!
I was working in OnOnline. Moving it to a script event on the scene director worked beautifully, Thank you!
Juha,
My xml file drops pages that have passed, so always hitting the first page is fine.
I’m afraid the difference in naming from the original xml to the DataLinq source is what is keeping me from finding the correct macro.
I based this on a successful macro: Contests\Contest<Office.Name=@Office@>\Office\NameShort
I tried variations on this… ro, ro.slug, slug, ro slug, ro_slug and nothing worked.
Thanks,
James.