Hi Graham, If you are using the same script for multiple cards, then you could use a property:
set the someProp of cd x to y setProp someProp theData put the long id of the target into myTarget put line 1 of theData into field x1 of myTarget put line 2 of theData into field x2 of myTarget -- etc end setProp Maybe you don't even need theData and you could also use a simple command handler with the long id of a card as parameter. If you really want to open a card before putting text into itse fields, you can do this: lock messages lock screen push cd put bla into fld x pop cd unlock screen unlock messages -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com On 3 jun 2012, at 10:11, Graham Samuel wrote: > Thanks to Mark and Dar for your replies. I'm afraid I didn't explain myself > clearly, and I chose a stupid example of what I thought was the 'wrong' card > reference, which obscured my real problem, which is this - the handler which > I've called "doSomething" was written to take advantage of the context of the > card it belongs on, so there are lots of references to objects like > > put someFunction (fld "myField1") into fld "myField2" > > and a lot more complex stuff involving lists of object names etc. Obviously > in this context I don't have to write > > fld "myField2" of me > > or anything to set the context of the object name, because the path to the > object (the field in my example) is implied. What I was trying to do was to > recreate the context from outside the card, so that this type of coding would > still work. I naively assumed that if the defaultStack is changed by the > 'send', then the defaultCard (OK I know there is no such language reference > in LC but you know what I mean) would be changed too. In fact what happens is > that the new current card is simply the last card to be 'shown' in the new > stack. Really I don't even want to change stacks, just cards. My > simplification also obscured the fact that what I really do from card "A" is > to > > send "doSomething" to grp "someGroupedControls" of cd "B" > > but I don't think this changes anything. > > AFAICS I will simply have to put overt references into my handlers of this > type, which is a bummer because there are a lot of them. This would I suppose > be solved if I did something like > > go card "B" > > to start with (since it sets what I call the defaultCard), but then I would > have to devise a mechanism for getting back to card "A" after the handler is > executed, which looks pretty ugly to me - but of course I could be wrong, > since I so often am. > > Well, you learn something new every day. > > Thanks again > > Graham > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode