Best way to edit config.json from Omnis

Phil (OmnisList) phil at pgpotter.co.uk
Wed Jun 2 08:58:24 UTC 2021


Hi Reg,

Presume your talking 10.2 ?

Setting one of the flags for the Mac environment, we use:

Calculaterowas $root.$prefs.$getconfigjson()


CalculateconfigRowas row.macOS


IfconfigRow.$cols.$findname('ignoreTitleClicksInBackground')

Else


DoconfigRow.$cols.$add('ignoreTitleClicksInBackground',kBoolean)

CalculateconfigRow.ignoreTitleClicksInBackgroundas kFalse

Calculaterow.macOSas configRow


Do$root.$prefs.$setconfigjson(row)

End If


As you can see this is adding a new entry... but it will show you the 
process, and how easy it is.

regards
Phil Potter
Based in Chester in the UK.

On 02/06/2021 09:42, Reg Paling wrote:
> Yes, "disableInRuntime", or "updateFileAssociations", or any other 
> parameter.
>
> On 2/6/21 5:34 pm, Andrew McVeigh wrote:
>> Is this to read and then set the server parameter correctly ?
>>
>> Andrew McVeigh
>> Surfway Real Solutions
>> Phone 02 44412679 Mobile 0418428016
>> www.surfway.com.au <http://www.surfway.com.au>
>> www.berrarabeach.com.au <http://www.berrarabeach.com.au>
>>
>>
>> <http://www.surfway.com.au/>
>> <http://www.surfway.com.au/>
>>
>>> On 2 Jun 2021, at 4:38 pm, Reg Paling <Reg.Paling at Lokanet.com 
>>> <mailto:Reg.Paling at Lokanet.com>> wrote:
>>>
>>> Hi everyone,
>>>
>>> OK, so if I want to edit the config.json file from Omnis, I could 
>>> either
>>>
>>>    Read it into a text field and use replace() and so on
>>>
>>>       OR
>>>
>>>    Use one of the functions like JSONtoListOrRow to get it into a 
>>> row or list or whatever, do the changes directly by accessing e.g. 
>>> MyJSONConfigRow.TheAttribute and then converting the row/list back 
>>> into JSON and saving the file.
>>>
>>> The second option is going to be cleaner, provided it works 
>>> reliably.  I'm wondering if anyone has tried it that way.
>>>
>>> Thanks,
>>> Reg
>
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 


More information about the omnisdev-en mailing list