[TxMt] question: how to insert a "" from javascript?

Piero D'Ancona pierodancona at gmail.com
Tue Sep 26 09:27:37 UTC 2006


Hi, 
one never really escapes the escape tunnel.
I have a new problem with escapes.
>From the command line I can ask
TextMate to insert a backslash:

osascript -s 'tell app "TextMate" to insert "\"'

I want to do the same from a javascript
contained in an a href link. But I can not find the
correct way to escape things. Allan's suggestion
works perfectly with ordinary text; the following
html code:

<a href="javascript:TextMate.system("/usr/bin/osascript &>
/dev/null -e 'tell app \"TextMate\" to insert 
\"TEXTTOINSERT\"' &&quot, null);">
TEXTOFLINK</a><br>

produces a link TEXTOFLINK and when I click on it,
TEXTTOINSERT is inserted into TextMate. But if
TEXTTOINSERT contains a backslash, it is ignored.
A pity since I want to insert a tex command...
What should I write instead of TEXTTOINSERT to
get, say, "\eqref" to be inserted? Yes, I am escape-blind.
Thanks for any help,

Piero

PS hm... no one seems to like my new idea for label 
completion. I'll keep it for personal use :)





More information about the textmate mailing list