[TxMt] DIALOG2 popup Question

Ciarán Walsh ciawal at gmail.com
Thu Apr 17 15:22:45 UTC 2008


On 17 Apr 2008, at 09:54, Hans-Joerg Bibiko wrote:

>
> On 17 Apr 2008, at 16:40, Ciarán Walsh wrote:
>>
>> On 17 Apr 2008, at 09:31, Hans-Joerg Bibiko wrote:
>>
>>> But if I write an other tmCommand in BASH, it works but I do not  
>>> see what I'm typing and the output behaviour is also different (it  
>>> gives me back the plist as well).
>>
>> Since the --wait flag causes dialog not to return until a choice is  
>> made, you must run the command in the background so that control is  
>> returned to TextMate right away (the Ruby complete() API does this  
>> for you, and supports the block).
>> i.e., try adding '&>/dev/null &' to the end of the command
>
> Yes. This works. But then I can write simply:
>
> echo '...'  | "$DIALOG" popup --initial-filter "$TM_CURRENT_WORD"
>
> without --wait to have the same behaviour. It's seems to me that -- 
> wait is useless in BASH(?)
>
> Because, if I write:
>
> echo '...'  | "$DIALOG" popup --wait --initial-filter  
> "$TM_CURRENT_WORD" &
>
> it does not work. My intention also was to get back the selected  
> item as plist and do something with it. But I must write &>/dev/null.

See http://pastie.textmate.org/private/ontx9ap7jdensks4peffg for how  
you could get the result from the popup. What are you planning to do  
with it though? You could use e.g.

osascript -e'tell app "TextMate" to insert "foo" as snippet yes'

to insert a snippet based on the result.


More information about the textmate mailing list