How to get all message names

Björnke von Gierke bvg at mac.com
Fri Feb 3 16:44:38 EST 2012


Well, I query the documentation content, so because of that, 'my' content is only as good as theirs. The easiest way is of course to use my stack, then take the information out of the gui, or look into the sql with your favourite sqlite tool. For getting the names of all messages in my gui, you can do the following:

make sure the search field is empty
click on "topics" in the navigation (top left, third button)
select "terminology types" in the drop down that appears
scroll down and select "message" in the first list field
hover the mouse over the field that shows all the messages
in the message box: put the text of the mousecontrol into x; split x by return and tab; put the keys of x

Now, that's of course not accurate always for new releases, but you could prepare the info for existing rev installations that way.

To get at the data within the users current IDE directly, you'd need to look at the code of the bvg docu stack. the handler "docuLibCreateContent" should contain code that interest you. Most likely it'd be enough to look at the index. It contains everything the extended list view of the built in docu shows (for quicker access, and searchability). So i think you want that file, in the current edition it's at the following path (mac os x):

/Applications/LiveCode 5.0.2.app/Contents/Tools/Documentation/dict.index

Use this line of code (from my stacks script), to decode the file's content into something useful.

   put arraydecode(url ("binfile:" & docuPath & "dict.index" )) into theArray

There probably is a key in that array, similar to "type" or "kind". The first key of the multidimensional array is the term name, so I suggest you do this:

   put the keys of theArray["mouseUp"]
   put theArray["mouseUp"]["type"] --or whatever you find it is, when querying the keys as above

I hope this gets you started, and closer to your information :)

cheers
Björnke

PS: be aware that RunRev randomly changes their approach, last time with 4.5.0 (if i remember correctly), before that the index file was not array encoded, but just a plain tab delimited list.



On 02.02.2012, at 14:45, Claudi Cornaz wrote:

> Hi All,
> 
> Thanks for answering.
> 
> Unfortunatly there apparently isn't a easy consistent way. Pitty. I need it for stackAlly and
> it looks to get the messageNames it depends on how the version of livecode
> uses it for the dictionaire, which ofcourse might change with each release. 
> So no relaible stabble  way to get the message names. Most unfotunate
> 
> Björnke, apparently you can get it out of the dictionaire (the sglite db file on disk)
> Could you share/mail me how to do that? Would be great.
> 
> Thanks all and best wishes,
>   Claudi
> 
> 
> 
> 
> On 30 jan 2012, at 23:04, Björnke von Gierke wrote:
> 
>> If you need help, just ask me directly :)
>> 
>> On 30.01.2012, at 18:01, Mike Bonner wrote:
>> 
>>> Ok so maybe its an encoded array of xml data. I'm thinking use the sqlite
>>> db generated by the bvgdocu to do this.
>>> 
>>> On Mon, Jan 30, 2012 at 9:55 AM, Mike Bonner <bonnmike at gmail.com> wrote:
>>> 
>>>> This may be a roundabout method but.. If you go here
>>>> http://bjoernke.com/index.irev?target=bvgdocu  and download bvgdocu 2.0
>>>> it generates an sqlite database of the dictionary where the "type" column
>>>> contains the type of entry. Message, etc.  It might be possible to use the
>>>> sqlite db directly, and if not dig around and see exactly how the info was
>>>> generated.
>>>> 
>>>> After poking around in the code it appears that the .index files located
>>>> in  (C:\Program Files (x86)\RunRev\LiveCode 5.0.2\Documentation) are
>>>> encoded arrays. So some method similar to what bvg did should work to
>>>> extract the info you are looking for directly from the files. Maybe?
>>>> Haven't done it so my level of clue on this stuff is still pretty low.
>>>> 
>>>> 
>>>> On Mon, Jan 30, 2012 at 8:34 AM, Klaus on-rev <klaus at major.on-rev.com>wrote:
>>>> 
>>>>> Hi Craig,
>>>>> 
>>>>> Am 30.01.2012 um 16:08 schrieb dunbarx at aol.com:
>>>>> 
>>>>>> Clever, Klaus.
>>>>> 
>>>>> :-)
>>>>> 
>>>>> But this is only step 1...
>>>>> 
>>>>>> But there are lots of groups in the stack "revDictionary". I selected
>>>>> "message" to load the DG, and then went through each group and tried to
>>>>> extract the dgText which contained, say, "mouseUp". Nothing. Do you know
>>>>> what the name of the dataGrid is?
>>>>> 
>>>>> No, sorry, I just looked by myself and that is very well hidden somehow.
>>>>> 
>>>>>> And why would my method not work?
>>>>> 
>>>>> Sorry, no idea.
>>>>> 
>>>>>> Craig Newman
>>>>> 
>>>>>>> ...
>>>>>>> Hi all,
>>>>>>> 
>>>>>>> Does anyone know how to quickly get all livecode message names?
>>>>>>> 
>>>>>>> I know you can get the propertyNames, the functionNames, the
>>>>> commandNames
>>>>>>> but I get a error when doing get the messageNames or a couple of
>>>>> similars.
>>>>>> 
>>>>>> Open the dictionary.
>>>>>> In the left index click: Language -> Commands
>>>>>> 
>>>>>> Now you only need to extract this list from the first column of the
>>>>> datagrid :-)
>>>>>> 
>>>>>>> Thanks in advance,
>>>>>>> Claudi
>>>>> 
>>>>> Best
>>>>> 
>>>>> Klaus
>>>>> 
>>>>> --
>>>>> Klaus Major
>>>>> http://www.major-k.de
>>>>> klaus at major.on-rev.com
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> use-livecode at lists.runrev.com
>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>> 
>>>> 
>>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list