Accessing AddressBook.data: javascript?

Raymond Griffith rgriffit at ctc.net
Wed Jan 11 17:26:21 EST 2006




On 1/11/06 4:54 PM, "Martin Baxter" <mb.ur at harbourhost.co.uk> wrote:

> Klaus Major wrote:
>> 
>> And has anybody already "done" something AS Javascript????
>> THAT would be very intersting! ;-)
>> 
>>> Tom
> 
> yep, I guess so,
> 
> I just did this:
> 
> put "Core.pick("&quote&"Pick a Boy:"&quote&comma into js
> put "["&quote&"Manny"&quote&comma&quote& "Moe" after js
> put quote & comma & quote &"Jack"&quote &"])" after js
> do js as javascript
> put the result

Try this:

 put "Core.pick(*Pick a Boy:*,[*Manny*,*Moe*,*Jack*])" into js
 do replacetext(js,"*",quote) as javascript
 put the result

This is a favorite trick of mine. Having to put in all those &quotes and
commas into a do-statement is tedious, and often makes the script
unreadable. Using an unneeded symbol in the place of a quote and replacing
it later improves readability tremendously.

Cheers!

Raymond E. Griffith
> 
> which puts up an alert featuring a list field populated with the entries
> Manny, Moe, Jack and returns the text of the line you choose.
> 
> the example is adapted from the Intro pdf
> 
> Does that count?
> 
> Martin
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list