Hi fre,
you are lacking a lot of basic stuff!
I recommend to work through these stack here:
http://www.runrev.com/developers/lesson ... nferences/
There is more than one line in your script that will not work and trying to set custom properties via an array is erm... unusual and quite creative
OK, I do not know much about your project so I cannot say if creating new buttons is the way to go, athough I doubt.
1. "linktext" is a property of text chunks inside of fields! Won't work for LABELS of buttons!
2. Buttons need to be clicked, so an eventual "mouseup" handler gets triggered, which leads to the conclusion that your buttons
also might need a "mouseup" script to do what you want.
3. Athough you did not mention this, the scripts shows that your buttons should navigate to a specific card after clicked, right?
This is the same mechanism as my internet URL example in my last posting.
4. Please do yourself a favour and lookup all (known or unknown) terms in the Rev dictionary, which isn't that bad
5. To start lookup "templateXXX" in the docs.
Here my attempt to make you script (excerpt) work:
Code: Select all
...
put 0 into tButtonNumber
## I will NOT use an array here, but fetch the second item of each line, see ITEMDEL below...
## Of course you way does also work!
set itemdel to TAB
-- tData is an array of data from mysql database
repeat for each line tLine in tData
put item 2 of l into tLabel
create button ("b" & tButtonNumber)
set the label of button ("b" & tButtonNumber) to tLabel
-- now give the button a link destination and apend an id ...
##ID ??
## Here we need to create a SCRIPT for the buttons, see above!!!
## This will only work with scripts < 10 lines!
## See "scriptlimit" in the docs!!
set the script of button ("b" & tButtonNumber) to "on mouseup" & CR & \
"put the cTargetCardName of me into tTargetCard" & CR & \
"go card tTargetCard" & CR & "end mouseup"
## set the custom property:
set the cTargetCardName of button ("b" & tButtonNumber) to "mycard"
end repeat
....
This will make your buttons work as you would exspect (or what I think you do exspect

)
Best
Klaus