Bonjour Hussein,
Thank's for simplification, the variables were there to test with alert ,and I
did'nt suppress them.
For the other thing, it's possible to active the menu entry only when the user
insert a <A> or the parent of <A> is the current node?
--
Cordialement,
Marc Courriel : Marc.Liste at free.fr
-----------------------------------------
Le jeudi 25 janvier 2007 ? 10:07:52, vous ?criviez :
HS> Marc wrote:
>> Thank you very much, here is my sequence who does what I want,
>> <sequence>
>> <command name="selectFile" parameter="openFileURL %d"/>
>> <set expression="%_" variable="NomFichier"
>> plainString="true"/>
>> <get expression="$NomFichier"/>
>> <set variable="Liste"
>> expression="join(document($NomFichier)//@name,' ')"/>
>> <get expression="$Liste"/>
>> <command name="pick" parameter="'Choisir AccrocheLien'
>> false %_"></command>
>> </sequence>
>>
HS> Congratulation for your macro!
HS> Possible simplification (unless you need to keep $NomFichier handy for
HS> other uses):
HS> ---
HS> <sequence>
HS> <command name="selectFile" parameter="openFileURL %d"/>
HS> <get expression="join(document('%_')//@name,' ')" />
HS> <command name="pick" parameter="'Choisir AccrocheLien' false %_" />
HS> </sequence>
HS> ---
>> but now I want to bind this to an event when the user add a element <A>.
HS> You cannot do that. You need to add a toolbar button or a custom binding
HS> which not only inserts an <A> (or if some text is selected, converts
HS> selected text to an <A>) but also, after that, immediately triggers the
HS> above macro.
HS> --
HS> XMLmind XML Editor Support List
HS> xmleditor-support at xmlmind.com
HS> http://www.xmlmind.com/mailman/listinfo/xmleditor-support