[TxMt] tm_dialog: *.plist | pl -> utf8 SOLUTION

Hans-Joerg Bibiko bibiko at eva.mpg.de
Sat Nov 18 13:08:00 UTC 2006


> On 17. Nov 2006, at 16:25, Hans-Joerg Bibiko wrote:
>
>> [...] I wrote two BASH scripts 'plutf8' and 'defaultsread'.
>>
>> [...] Maybe these scripts are worth to put into the TM release (?)
>>
>> Comments??
>
> While I would certainly love to make it easier to work with plists from
> pure bash scripts, the problem is, that the old-style format does not
> support dates, booleans, and integers.

By myself I don't use pl or plutf8. I wrote it only for somebody who  
wants to use it.


>
> Booleans and integers I guess are fine as strings (0/1 for booleans).
> Dates, I am not sure what the best representation is, but probably the
> YYYY-MM-DDTHH:MM:SSZ variant.
>
> But if this is only for shell, how about making a function exports them
> as variables? Then we can also have it use bash arrays for arrays.
>

Well, I find it quite convenient to use 'defaults read/write/delete'  
out from bash. With 'export A=$(defaults ...)' you can publish BASH  
variables for other scripts. I use 'defaults write -array' and so  
forth to set plist before I send it to tm_dialog.

You mean that each variable coming from tm_dialog should be published  
as BASH variable. But then you have all variables even if you don't  
need some. E.g. I use one plist for two different tm_dialogs which  
share only one key.

Well, I will try to write such a function which reads for a speficied  
key(s) the value, array, date,... to put it in a BASH variable and a  
function which publish all keys from a plist as BASH variable.


Best,

Hans


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the textmate mailing list