General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Automatically Update Macros for Writers

  • levinsontodd

    Automatically Update Macros for Writers

    Participants 2
    Replies 3
    Last Activity 10 years, 9 months ago

    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

    Reply

    gcrews

    Reply to: Automatically Update Macros for Writers

    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.

    Reply

    Derek Read

    Reply to: Automatically Update Macros for Writers

    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).

    Reply

    gcrews

    Reply to: Automatically Update Macros for Writers

    yeah you could proboly do something  similar to this:

    [code]function updateMacros() {
    var fso = new ActiveXObject(“Scripting.FileSystemObject”);
    var path = “\\\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()
    }
    [/code]

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support