Economy-x-Talk - Sample Scripts
Copy Objects from/to a Stack
Here is a script that re-creates (instead of copies) the objects from the reference or template stack. It is set up for objects in the background but can be adapted for objects on the cd layer. (I only tested this with fields but should also work with buttons.
-- Stan Soria
on createNewObjects
global objectProperties
set cursor to watch
lock screen
-- get the object properties from template stack
repeat with i =1 to (number of bg parts)
put word 2 of (long name of bg part i) & ";" into line i of objectProperties
put (style of bg part i) & ";" after line i of objectProperties
put (rect of bg part i) & ";" after line i of objectProperties
put (textfont of bg part i) & ";" after line i of objectProperties
put (textsize of bg part i) & ";" after line i of objectProperties
end repeat
-- now go to the destination and create new objects
go stack "destination" in a new window
domenu "background"
set the itemdelimiter to ";"
-- revised section of script follows
repeat with i =1 to (number of lines in objectProperties)
put item 1 of line i of objectProperties into objectType
doMenu ("new" && objectType)
put "bg" && objectType && "id" && (id of last bg part) into id_objectType
set the style of id_objectType to item 2 of line i of objectProperties
set the rect of id_objectType to item 3 of line i of objectProperties
set the textfont of id_objectType to item 4 of line i of objectProperties
set the textsize of id_objectType to item 5 of line i of objectProperties
end repeat
domenu "background"
set the itemdelimiter to ","
end createNewObjects
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.