Raymond, Jocelyn wrote:
> How can I execute a "run" or "start" command based on the OS (Mac or 
> Win)?  In other word, if xxe is running on a Mac, when trying to execute a
> <command ...>
>   <macro>
>     <sequence>
>       <command name="run" parameter="if Mac use this else use that"/>
>     </sequence>
>   </macro>
> </command>
>  
> I tried playing with <pass> but it works only for one OS at a time 
> (depending on the test).  I am using xxe-2.11 (sorry, old version but we 
> paid for it and our process currently only works with this version - no 
> time for upgrading our process)
> The main problem is that whenever I use "run", the relative path is 
> different for Mac and Win.  I am trying to "run" a ANT target.  Also, I 
> *must* put my application inside <XML-Mind-Install>/addon/config and not 
> into <username>/.xxe2/config/.  My ant script is located inside 
> addon/config/<myapp>/xml/...
>  
> I was hoping to do something like:
> <command name="run" parameter="../addon/config/lib/ant/bin/ant 
> -buildfile ../addon/config/<myapp>/xml/build.xml targetone"/>
>  
> which would work for both platform.  However, the relative path for the 
> Mac is always: /Applications
> I also tried all the xxe variable such as %{D} and %{C} with no success.

Currently the solution of this problem is fairly simple. Example:

---
<command name="untabify">
   <macro>
     <sequence>
       <choice>
         <command name="run"
                  parameter='[Windows] C:\cygwin\bin\expand "%F"'/>
         <command name="run"
                  parameter='[Unix] expand "%F"' />
       </choice>
       <command name="paste" parameter="toOrInto %_" />
     </sequence>
   </macro>
</command>

<binding>
   <keyPressed code="ESCAPE" />
   <charTyped char="8" />
   <command name="untabify" />
</binding>
---

Notice [1] the use of <choice> [2] The "[Windows]" and "[Unix]" 
prefixing the commands. A "[Mac]" option is available too, see: 
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/run.html

However this will *not* work in XXE v2.11 (July 11, 2005) as the 
platform option has been added to command run in XXE v3.1.0 (January 30, 
2006). See http://www.xmlmind.com/xmleditor/changes.html




Reply via email to