General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › How to set the ‘Ask before saving’ value through API
-
lqian July 31, 2009 at 6:04 am
How to set the ‘Ask before saving’ value through API
July 31, 2009 at 6:04 amParticipants 4Replies 5Last Activity 13 years, 6 months agoHi,
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?
Derek Read July 31, 2009 at 4:36 pm
Reply to: How to set the ‘Ask before saving’ value through API
July 31, 2009 at 4:36 pmThere 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?
lqian August 3, 2009 at 1:00 am
Reply to: How to set the ‘Ask before saving’ value through API
August 3, 2009 at 1:00 amThanks 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.
Derek Read August 3, 2009 at 9:11 am
Reply to: How to set the ‘Ask before saving’ value through API
August 3, 2009 at 9:11 amI 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.
Polly Poon September 18, 2009 at 7:08 am
Reply to: How to set the ‘Ask before saving’ value through API
September 18, 2009 at 7:08 amHi,
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=10After 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?
dcramer September 18, 2009 at 1:56 pm
Reply to: How to set the ‘Ask before saving’ value through API
September 18, 2009 at 1:56 pmTry setting the value in C:Documents and Settings
Application DataSoftQuadXMetaL#.#XMetaL##.ini (where is the logged in user's name and ## is the XMetaL version). David
-
AuthorPosts
- You must be logged in to reply to this topic.