Page 1 of 1
Get scriptlines per card in a stack
Posted: Fri Mar 18, 2016 5:26 pm
by mrcoollion
I again have a question.
I want to go through all the script lines per card in a stack and get information from those scriptlines.
I will be using this to make a translation routine that filters all scriptlines on e.g. message texts and puts those in a database for translation purposes.
How can i make this possible
PS. I have made a routine that gets all objects from all cards and puts those in a database so I can make a translation.
Regards,
Paul
Re: Get scriptlines per card in a stack
Posted: Fri Mar 18, 2016 6:29 pm
by mrcoollion
Already found the answer myself. See example script I made below.
Code: Select all
on mouseUp
put the name of this stack into tCurrentStack
put the short name of this stack into tCurrentStackShort
put the id of this stack into tCurrentStackID
put the cardNames of stack tCurrentStack into tCards
repeat with tCardIndex = 1 to the number of lines in tCards
put line tCardIndex of tCards into tCurrentCard
put the id of card tCurrentCard into tCurrentCardID
put the script of card tCurrentCard into CardScriptLines
answer the number of lines in CardScriptLines
repeat with tLineIndex = 1 to the number of lines in CardScriptLines
answer "Stack: "& tCurrentStackShort & lf & "Card: " &tCurrentCard & lf & "Script line: "& line tLineIndex in CardScriptLines
put "breakpoint"into tempVar// Just to enable me to put a breakpoint here here
end repeat
end repeat
end mouseUp
Re: Get scriptlines per card in a stack
Posted: Fri Mar 18, 2016 8:05 pm
by dunbarx
I made a script analyzer for another purpose. Generically, you can (pseudo):
Code: Select all
repeat with y = 1 to the number of cds
doSomething with the script of cd y
repeat with u = 1 to the number of controls of cd y
doSomething with the script of control u of cd y
end repeat
doSomething with the script of this stack
end repeat
Craig Newman
Re: Get scriptlines per card in a stack
Posted: Fri Mar 18, 2016 8:38 pm
by mrcoollion
Thx for the support Craig
