Hola Jesus,
sound like you make this unneccessarily complicated!?
No need for cloning/copying stuff and create scripts on the fly, which is a bad idea anyway.
You can have a the SAME fields (segundos/minudos) fields on every card when you GROUP these two fields!
Do something like this:
1. Select these two fields on the first card they appear. Delete all duplicates from other cards first.
2. GROUP (command-G or use the menu OBJECT -> Group Selected)
3. Give that new group a name, maybe TIMER.
4. No go to every card you want to show the timer and use menu OBJECT -> Place group -> TIMER (or whatever you named that group)
5. Move these handler to the STACK script:
Code: Select all
global Segundos
global Minutos
on IniciaSegundos
put empty into fld "Segundos" OF BG "TIMER"
put 0 into Segundos
put 0 into Minutos
ActualizaSegundos
end IniciaSegundos
on ActualizaSegundos
if Segundos >= 0 and Segundos <60 then
put Segundos into field "Segundos" OF BG "TIMER"
put Segundos + 1 into Segundos
send "ActualizaSegundos" to me in 1 second
end if
if Segundos =60 then
add 1 to Minutos
put Minutos into fld "Minutos" OF BG "TIMER"
put 0 into Segundos
end if
end ActualizaSegundos
This way we can have the timer running all the time and the fields get filled with the correct value,
even if that goup is NOT part of the current card!
Hint:
Since this way we actually have the SAME two fields on the cards, their location will always be the same
where you last set it! If neccessary, you can set the location of grp "timer" "on preopenstack".
Best
Klaus