Economy-x-Talk - Sample Scripts
Copy Color Data
Copy a colorized card and paste it, with all it's colors intact. NOTE: The number 256 adequately covered the number of buttons, fields, and color rects combined, change this number to suit you :-) The background colors pasted intact without special scripting.
-- Shari
on doCopy -- the handler that calls copy/paste card
global var2
copyColorData
doMenu "Copy Card"
doMenu "Paste Card"
repeat with x = 1 to the number of lines of var2
do line x of var2
end repeat
end doCopy
-- in the stack script of the stack you are copying the card into
on copyColorData
global var2
put empty into var2
repeat with i = 1 to 256
set cursor to busy
AddColor getObjectType,cd,i
put the result into hit
if hit is empty then
exit repeat
end if
if hit is "rectType" then
addColor getObjectBounds,cd,i
put the result into rectSpot
addColor getObjectColor,cd,i
put "addColor addRect,cd," & quote & rectSpot & quote & comma & ¬
quote & the result & quote & comma after var2
addColor getObjectBevel,cd,i
put the result & comma & i & return after var2
end if
if hit is "buttonType" then
addColor getObjectBounds,cd,i
put the result into btnSpot
repeat with n = 1 to the number of cd buttons
if the rect of cd btn n = btnSpot then
put the id of cd btn n into btnId
exit repeat
end if
end repeat
addColor getObjectColor,cd,i
put "addColor addButton,cd," & btnId & comma & quote & the result ¬
& quote & comma after var2
addColor getObjectBevel,cd,i
put the result & comma & i & return after var2
end if
if hit is "fieldType" then
addColor getObjectBounds,cd,i
put the result into fldSpot
repeat with m = 1 to the number of cd fields
if the rect of cd field m = fldSpot then
put the id of cd field m into fldId
exit repeat
end if
end repeat
addColor getobjectColor,cd,i
put "addColor addField,cd," & fldId & comma & quote & the result & quote & comma after var2
addColor getObjectBevel,cd,i
put the result & comma & i & return after var2
end if
end repeat
end copyColorData
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.