Pages: 1
Print
Author Topic: Automatically Update Macros for Writers  (Read 357 times)
levinsontodd
Member

Posts: 1


« on: January 09, 2012, 02:18:31 PM »

Hi,

I work with a fairly large team and want to create a way to distribute macro updates without having the writers do anything. I have some ideas on how to approach this but I'm wondering if anyone has already done anything like this and has some advice. All the writers have a access to the same network drive.

Thanks,

Todd
Logged
gcrews
Member

Posts: 189


« Reply #1 on: January 09, 2012, 02:56:08 PM »

For us, I just created a startup macro that notifies the user when they open XMetaL. If they choose yes, XMetaL closes, my update tool runs and synchronizes everything, and then XMetaL opens again. The macro also ends if the user is  offline from the network.


* 1-9-2012 12-52-15 PM.png (7.38 KB, 387x178 - viewed 20 times.)
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 1548



WWW
« Reply #2 on: January 09, 2012, 03:56:33 PM »

If you are only making changes to macros you might also use the API Application.RefreshMacros() to reload MCR files. There is a similar ActiveDocument.RefreshCssStyle() API for CSS files. These may let you to bypass the need to restart the software in these specific cases.

Neither of these help with distribution, they merely reload the files after they have been modified by some other process (such as the one gcrews has suggested).

If you are using a CMS system check with the creator of the XMetaL-CMS integration (adapter) to see if it allows you to store and manage your document-level XMetaL customizations from within the CMS system.  Typically what happens in this case is that the XMetaL customization files are stored somewhere in the CMS and associated with a particular DTD. The DTD and those associated files (CSS, CTM, MCR, etc) are then pushed out to XMetaL together with the XML document. Documentum is one example (they refer to this set of files as a "DocApp", and similar functionality can be used to push files out to MS Word or other applications that integrate with Documentum).
« Last Edit: January 09, 2012, 04:07:03 PM by Derek Read » Logged
gcrews
Member

Posts: 189


« Reply #3 on: January 09, 2012, 04:55:01 PM »

yeah you could proboly do something  similar to this:

Code:
function updateMacros() {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var path = "\\\\<server>\\XMetaL.mcr";

//if offline end
if(!fso.FolderExists(path)) {
return;
}

var wshell = new ActiveXObject("WScript.Shell");
var appData = wshell.ExpandEnvironmentStrings("%appdata%");
var dest = appData + "\\SoftQuad\\XMetaL\\6.0\\XMetaL.mcr"
fso.CopyFile( path, dest , true)

Application.RefreshMacros()
}
« Last Edit: January 19, 2012, 01:31:40 PM by Derek Read » Logged
Pages: 1
Print
Jump to: