Pages: « 1 2 3 4 5 6 7 8 9 10 »
 on: June 21, 2017, 02:52:04 PM 
Started by akheiljain - Last post by akheiljain
XMetal macro JScript wont run

does any one know why or how to make it work?

 on: June 20, 2017, 08:12:30 AM 
Started by Fa - Last post by Fa
Hi Derek (and anyone else interested)!

Following up on this topic (sorry about the long delay!).

After discussion with my colleagues why they had ended up creating their own elements, it turned out that the main (and probably only) reason why they did that is that the program they develop uses context sensitivity.

The help file they create is a simple "single html file".

Since they are writing their code for the different modules before the corresponding help topics even exist, they already create a context sensitive link within the software pointing to an element that does not yet exist (in a file that does not yet exist either).

At first, they tried to use the topic id attribute value as a unique identifier, but it failed because of the way the conversion is done. When DITA-OT processes the xml topics, it collects all the links and targets (in this case the topic id's), and it renames all targets in the html to "#unique_01", "#unique_02", etc.

I guess the reason behind the behaviour is that since it creates a single html out of lots of small DITA files, it wants to make sure there are no duplicate anchors, and therefore, instead of having a mechanism that checks for duplicate, it just coldly replaces all names for anchors created from elements with new names that it knows are unique.

The drawback in this case is that there is therefore no way of knowing what to link to before the html has been built, and even then it would require a lot of manual work. That's how they came up with the idea of creating the help_anchor elements that they then process to become an html anchor (<a href="...">).

So my question now is: is there
a) a way to force XMetaL (DITA-OT) to keep the elements' IDs intact and transfer them to the href attribute value for anchors (<a>) in the html instead of replacing them by the #unique_nn value
b) an existing, valid DITA element that could be use for this purpose?

Thank you!

 on: June 20, 2017, 02:55:58 AM 
Started by MichaelLohr - Last post by MichaelLohr
Hi Derek,

Thanks a lot for your help.
The suggestion provided with the On_Drop_Files event macro worked for me.

Best regards,

 on: June 19, 2017, 05:19:19 PM 
Started by MichaelLohr - Last post by Derek Read
The documentation for all of the customization files supported by XMetaL software (all three editors) is included with XMetaL Developer in the Programmers Guide and the Customization Guide.

When using XMetaL Developer to create an MCR file you start with individual script files (in any scripting language you have a scripting engine installed for, but most often JScript or VBScript) and XMetaL Developer then compiles those into an MCR file when you build your project.

If you don't have XMetaL Developer but do have access to an installation of XMetaL Author Essential or Enterprise there are lots of MCR files included in those installations you could use as examples.

The MCR file format is a simple XML structure containing multiple macros. Each contains a separate script and some metadata that identifies the script language, gives the macro a name, a keyboard shortcut and a few other pieces of metadata that are not really useful for XMAX usage but that may come into play with XMetaL Author Essential or Enterprise.

Here's the simplest of examples of a file containing 2 macros:

<?xml version="1.0" encoding="UTF-8"?>
   <MACRO name="Test 1" lang="JScript"><![CDATA[
      //use JScript to display an alert dialog containing some text
      ActiveDocument.Host.Alert("This is test 1");

   <MACRO name="Test 2" lang="VBScript"><![CDATA[
      'use VBScript to display an alert dialog containing some text
      ActiveDocument.Host.Alert "This is test 2"

In the case of Addam's suggestion you would use name="On_Drop_Files" for the macro name. When the macro's name matches an event macro's name (as documented in the Programmers Guide) it fires when that event is triggered.

All other macros are effectively "user triggered" (vs "event triggered"). In the case of XMetaL Author Essential and Enterprise a dialog is available that lists all macros and the user can select one to run, or the user may use a shortcut key to trigger the macro (if defined, which in my example is not the case). XMAX does not provide this type of UI so it would be up to you (as a developer) to expose something like this to the user from your application's own UI. Your code would call XMAX's Run method (see the Programmers Guide) and specify a macro to run. The API method named "Run" can be used to run any macro (in all three editors).

 on: June 19, 2017, 12:06:46 PM 
Started by Consigliere - Last post by Derek Read
  • Place your plug-in at the correct location inside the DITA Open Toolkit (see the DITA OT documentation or possibly other instructions, which I believe you have already done).
  • Enable the setting named "run_plugin_integrator  =  yes" in the "Other output parameters" section on the Advanced tab in the Configure Output dialog.
  • The next time the DITA OT is run plug-ins will be integrated.

The setting is disabled by default to allow the DITA OT to run slightly faster.

 on: June 19, 2017, 06:41:49 AM 
Started by Consigliere - Last post by Consigliere
Hi everyone, I'm a newcomer to the XMetaL family. I started my internship as a Tech Comms Trainee a few weeks ago, and one of my first tasks was to figure out how to customize our company's PDF output on XMetaL. I'm using a fresh installation of XMetaL Author Enterprise 12 + DITA-OT 2.4. Before this, I used oXygen during my studies, so I've been burning through all possible material online to catch up with the differences. Which means I've gone through most topics both on this forum and the Yahoo DITA group.
But a very simple question still eludes me:

How, exactly, do I integrate a PDF plugin into XMetaL? I've read DITA for Print, checked various DITA-OT day presentations, lurked on forums, done a fair amount of trial and error, but I still cannot for the life of me understand how to get past this impasse. I've gone through the first ~80 pages of DITA for Print at least half a dozen times, but I never actually get the plugin integrated and working. Creating the plugin is simple enough, and there's always Jarno Elovirta's PDF plugin generator too, but integrating them into the system seems to be the biggest problem here. DITA for Print recommends a batch file with the following in it:

call %DITA_DIR%bin\ant -f integrator.xml

This batch file does finish without a hitch, but it doesn't seem to actually do anything. It doesn't add the transtype to the deliverable type dropdown menu in XMetaL, nor does anything else for that matter. I've tried changing the value of cmd_dita_ot_per_user_version = n in order to force XMetaL to load the new plugins, but that didn't solve my problem either.

I've tried a few solutions that were given here - namely creating a new deliverable type and then changing the "Other Output Parameters" to RX_CUSTOM_DIR  =  <path to the plugin folder/customization folder>, but that didn't work either. I also tried specifying an XSL stylesheet to override the default one, but the only visible change I got after going through all XSLs was just a larger margin. It was indeed one of the changes I had made, but I had also increased the font sizes and changed font colors, yet none of those appeared.

Sorry for the lengthy message, but this is driving me up the wall. I must be missing something completely obvious, since no one online seems to have the same problem. Any sort of guidance would be greatly appreciated, but if possible, please explain it like I'm 5 years old. I fear I might be missing some crucial step. It doesn't help either how a lot of the material online just skips this part as something completely obvious.

-Fresh install of XMetaL 12 and DITA-OT 2.4
-Trying to create a PDF plugin
-Plugin won't integrate and the transtype won't appear in the list

 on: June 19, 2017, 03:27:23 AM 
Started by MichaelLohr - Last post by MichaelLohr
Hi Addam,

Thanks for your information.
I'm pretty new to XMAX development.
How do I use this *.mcr file?
I can only see a *.ctm file next to my xsd. Do you have any documentation regarding the *.mcr file?

Best regards,

 on: June 13, 2017, 08:55:59 PM 
Started by MichaelLohr - Last post by XMetaLOldTimer
I put together a HTML sample to try this out and I am seeing the same behavior as you (re: OnDragOver and OnDrop event sinks are NOT called).  

So, I started up the debugger and internally, XMAX (and Author) handles this kind of drag'n'drop using the Windows WM_DROPFILES message.  The code will fire the On_Drop_Files event macro, if present, to permit hooking into this behavior.  XMAX cannot fully utilize this event macro because certain APIs are missing (re: Application.DropFileCount and Application.DropFileName).  Nevertheless, there is a way to disable this functionality by adding an empty doc-level "On_Drop_Files" event macro to your customization's *.mcr file.   Two caveats:

1. This disables dropping of ALL file types into the XMAX window.
2. The system still shows the drop cursor as a plus sign indicating the drop is allowed (eventhough nothing happens later).


 on: June 13, 2017, 09:16:48 AM 
Started by MichaelLohr - Last post by MichaelLohr
Hi Addam,

Unfortunately neither the OnDrop event nor the OnDragOver is thrown if I drop a image from outside the XMAX windows ( from the windows explorer).
These events are only working if I do a drag drop action inside the XMAX control for example dragging an element from one parent to another.

Do you have any other ideas who to solve this.

Best regards,

 on: June 09, 2017, 12:04:25 PM 
Started by jshick - Last post by Derek Read
You might be able to use Find.Execute (the third option in that method, that you have set to be an empty string "", allows you to limit search to within certain elements -- check the Programmers Guide for its full syntax), but I don't think that's what you want.

If your form just needs to move the active selection to the next occurrence of an element then you probably want to use:

If that doesn't point you in the right direction what is the exact goal of your script (in Tags On or Normal views)?

Pages: « 1 2 3 4 5 6 7 8 9 10 »