Pages: 1
Print
Author Topic: Global Event Macros  (Read 4235 times)
gcrews
Member

Posts: 265


« on: October 28, 2010, 01:02:49 PM »

When I put the following code in xmetal.mcr it does not get run when I change view. I suspect this is because there is already a macro in the topic_ditabase.mcr , Is there any way to make a global event macro that applies to all types and not have to edit every single mcr for each type?
<MACRO name="On_View_Change" lang="JScript"><![CDATA[
test();
function test()
{
   Application.Alert("Hello World");
}
]]></MACRO>

Another thing, Is there a way to get Xmetal to reload a document when you open the file and it is already open?
« Last Edit: October 28, 2010, 01:18:49 PM by gcrews » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: October 28, 2010, 02:29:45 PM »

I'll have to investigate the conflict you seem to be having, I think your suspicion is probably correct however.

You can reload a document using the Reload() method.
Logged
gcrews
Member

Posts: 265


« Reply #2 on: November 08, 2010, 04:27:06 PM »

When I try to use ActiveDocument.Reload() on a DITA document,  Xmetal pops up the dialog asking for a dtd. 
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: November 08, 2010, 05:02:03 PM »

I'm not sure why this would occur for DITA documents but I suspect it is because we have some logic in the DITA functionality that does some fancy catalog lookups or it might be part of the redirection code we use when checking to see where a document should open (topic vs map with a decision to open maps in the Map Editor or Tags On / Normal view).

Why do you need to do a reload? Perhaps knowing that will let me figure out another means. Note that customizing the DITA functionality is not supported so there may not be any supported way to do what you want to do.
Logged
gcrews
Member

Posts: 265


« Reply #4 on: November 09, 2010, 01:02:05 PM »

With a fresh install of Xmetal 6.0.1.030 , on the reviewer sample document it still asks me for the DTD on ActiveDocument.Reload(); . I tried the macro in the application level macros and document type level, both locations cause the same issue.

<MACRO name="Macro Name" key="~" lang="jScript"><![CDATA[
ActiveDocument.Reload();
]]></MACRO>



* dalog.PNG (28.73 KB, 565x535 - viewed 552 times.)
Logged
gcrews
Member

Posts: 265


« Reply #5 on: November 17, 2010, 09:01:19 AM »

can anyone verify this? it sure would be nice to be able to reload the document though macros automatically on demand.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #6 on: November 17, 2010, 11:05:14 AM »

Yes, I have verified it (the issue occurs). I think what you're looking for is a quick fix. That I don't have.

If you can answer the question about why you need to do this I can communicate that to the development team and we might be able to figure something out. In addition, knowing that will allow us to build requirements into the DITA functionality that are currently missing.
Logged
Pages: 1
Print
Jump to: