To see the custom properties (two words!) of an object you can:
...
answer the CUSTOMKEYS of btn xyz
# or whatever object you need
...
To get or set a specific custom porperty yôu need to supply the name of the property:
...
put the cMyCustomProperty of fld "field 666"
...
set the cMyCustomProperty of fld "field 666" to "whatever you want to..."
...
So you can loop through the "CUSTOMKEYS" to get the names and values of the custom properties of your object:
(Quick and dirty script! Needs a lot of finetuning, but may get you started!)
...
put the CUSTOMKEYS of btn "my button" into tCK
repeat for each line i in tCK
put i & TAB & the i of btn "my button" after tVariable
end repeat
put tVariable into url("file:myCustomProps.txt")
## This will only work for TEXT in custom porperties, since they can also hold binary data.
## Drop a line if you also want to process binary data!
...
Ok thanks, I want to save a grps I have a created on a card of a stack... So i wanted to save their customproperties and then rebuild the groups by script.
on mouseUp
set the mainstack of stack "libBinConvert" to "libBinConvert"
set the mainstack of stack "toolbox" to "toolbox"
set the mainstack of stack "Completer les informations" to "Completer les informations"
set the mainstack of stack "Atelier" to "Atelier"
save this stack as "test6"
set the mainstack of stack "libBinConvert" to "Ergotool_IHM"
set the mainstack of stack "toolbox" to "Ergotool_IHM"
set the mainstack of stack "Completer les informations" to "Ergotool_IHM"
set the mainstack of stack "Atelier" to "Ergotool_IHM"
end mouseUp
on mouseUp
set the mainstack of stack "libBinConvert" to "libBinConvert"
set the mainstack of stack "toolbox" to "toolbox"
set the mainstack of stack "Completer les informations" to "Completer les informations"
set the mainstack of stack "Atelier" to "Atelier"
delete this stack
go stack url("test6")
set the mainstack of stack "libBinConvert" to "Ergotool_IHM"
set the mainstack of stack "toolbox" to "Ergotool_IHM"
set the mainstack of stack "Completer les informations" to "Ergotool_IHM"
set the mainstack of stack "Atelier" to "Ergotool_IHM"
end mouseUp
It works, but do you think it will work in a standalone, my mainstack is "Ergotool_IHM", and i only want to save "Ergotool_IHM" without its substacks so I change the mainstack.... thanks.
this will definitively NOT work in a standalone, since standalones cannot save themselves!
So whatever you do, the changes will not get saved!
AND you(r user) may not have write permission in the current folder/application folder, too!
Get used to save everything to external files in the users preferences folder, where you have write permission!
hm, what exactly do you want?
1. Save some custom proprerties and read them in again?
2. Save a new or modified card?
#1 was already explained in one of my earlier answers.
# 2 is definitively NOT easy and might make a radical change of your application design neccessary!
on mouseUp
lock screen
create invisible stack "Sauvegarde"
copy cd "vue" of stack "Ergotool_IHM" to stack "Sauvegarde"
set the mainstack of stack "Sauvegarde" to "Sauvegarde"
save stack "Sauvegarde" as "test17"
delete stack "Sauvegarde"
unlock screen
end mouseUp
and then I open the stack I saved and I replace my card.