General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion How to set the ‘Ask before saving’ value through API

  • lqian

    How to set the ‘Ask before saving’ value through API

    Participants 4
    Replies 5
    Last Activity 12 years, 11 months ago

    Hi,

    Just Wondering whether any one knows how to set 'ask before saving' in XMetal through API.

    In xMetal Tools/Options/File, there are attributes about 'Automatic Saves'.(See Attachment. Can I set the value for these attributes programmatically?

    Reply

    Derek Read

    Reply to: How to set the ‘Ask before saving’ value through API

    There are no APIs for this.
    The only way to do this programmatically would be to read/write the following INI settings using FSO or something similar:

    max_changes_between_saves = {int}
    max_time_between_saves = {int}
    warn_before_saving = {bool}

    Can I ask why you need to do this?

    Reply

    lqian

    Reply to: How to set the ‘Ask before saving’ value through API

    Thanks for the quick reply.

    We are working on a process to tag and link references in the text element for a set of XML documents. This process will take hours to finish, and will run over night. The saving dialogue will hold up the process.

    We just want to disable the dialogue for automatic saving through the program so that we don't need to change our client's xMetal setting. Ideally, our application will switch off the 'Ask before saving' before the process starts, then switch it back on after the process finished.

    Reply

    Derek Read

    Reply to: How to set the ‘Ask before saving’ value through API

    I can see how this would be an annoyance. The only suggestions I have with our current software (one of which I hope will resolve the problem):

    1) Before setting your system to run your scripts set the value(s) high enough that the feature will not be triggered during the expected running time.

    2) Manually un-check the “ask before saving” checkbox (which seems to be what you have done already). If this machine is being used to process XML documents perhaps a human never uses it and so you can make this setting permanent.

    3) Attempt to incorporate into your scripts the use of the API ActiveDocument.Save() to periodically save the document (after every N of your own changes perhaps).

    4) Instead of manipulating your documents using XMetaL Author use XMAX instead. It does not implement the feature that is getting in your way.

    We were unaware that clients are using our software to manipulate documents so intensively that it literally takes hours to complete the task. If anyone is in a similar situation XMetaL Support would be interested to hear about what you are doing in detail. Our development team is working on some projects that might eventually aid in this area.

    Reply

    Polly Poon

    Reply to: How to set the ‘Ask before saving’ value through API

    Hi,

    I tried to set the maximum time between save for XMetaL Author using the ini file.

    I have added the following line into the xmetal55.ini file located in the XMetaL Author Program File directory:
    max_time_between_saves=10

    After saving the .ini file, i close XMetaL Author and start it again. I then check the value through Tools > Option > File
    And i found that the Save after for minutes is still set to 1000.

    I then tried to set the Save after for minutes to 99, click Apply and close XMetaL. When i open XMetaL again, the value is correctly showing as 99.

    I also notice that the ini file has not been modified after i set this value.

    Is it possible to save this the max_time_between_saves value into ini file? If not, is it possible to automatically set this value?

    Reply

    dcramer

    Reply to: How to set the ‘Ask before saving’ value through API

    Try setting the value in C:Documents and SettingsApplication DataSoftQuadXMetaL#.#XMetaL##.ini (where is the logged in user's name and ## is the XMetaL version).

    David

    Reply

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

Lost Your Password?

Products
Downloads
Support