Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!dan From: dan@Apple.COM (Dan Allen) Newsgroups: comp.sys.mac.hypercard Subject: Re: Copying a background (hacker's tip & request for feature) Message-ID: <30160@apple.Apple.COM> Date: 5 May 89 16:11:53 GMT References: <39528@bbn.COM> Organization: Apple Computer Inc, Cupertino, CA Lines: 64 In article <39528@bbn.COM> mesard@BBN.COM (Wayne Mesard) writes: > >A) When in Background mode, the {Cut,Copy} Card menu items should change > to {Cut,Copy} Background. (And Paste Card becomes Paste Background.) > >B) The background of a card should be a set'able property of that card. > Thus, > set background of this card to "MyOtherBg" Thanks for the ideas and input. The one problem with copying and pasting a background in the same stack is that by doing so there will be two identical backgrounds. How do you know which is which? By ID would be the only way. A script could duplicate a background (more or less) with the following script: on duplicateBackground lock screen put the id of this card into old doMenu "New Background" put the id of this card into new go old choose field tool repeat with i = 1 to the number of fields select field i doMenu "Copy Field" go new doMenu "Paste Field" go old end repeat choose button tool repeat with i = 1 to the number of bg btns select bg btn i doMenu "Copy Button" go new doMenu "Paste Button" go old end repeat choose select tool doMenu "Background" doMenu "Select All" doMenu "Copy Picture" go new doMenu "Paste Picture" go old choose browse tool get the script of this bg go new set the script of this bg to it end duplicateBackground I just wrote this in a few moments and have briefly tested it. It allows background fields and buttons to be copied, as well as the background's script and picture. No card specific information is copied. Perhaps other enhancements could be made, but this is another example of how many, many things can be done with HyperTalk. Yes, it would be nice if we had a copy and paste of a background, but it is very rare that it is needed. For those that want to do it, the above script does it! Thanks again for the input. Dan Allen HyperCard Team Apple Computer