Skip to content

Commit

Permalink
Add -openBackup argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Nov 16, 2014
1 parent 68c6270 commit 07f228e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backupVersion.js
Expand Up @@ -12,6 +12,7 @@
// Arguments:
// -forceDate=true - force use last modification date
// -dateType=1 - see dateToString() in settings section
// -openBackup=true - open created backup file

// Usage:
// Call("Scripts::Main", 1, "backupVersion.js")
Expand Down Expand Up @@ -172,6 +173,11 @@ function askFileName(fileName) {
function _copy(curPath, curDir, newName, overwrite) {
try {
fso.CopyFile(curPath, curDir + "\\" + newName, overwrite);
if(AkelPad.GetArgValue("openBackup", false)) {
var lpFrame = AkelPad.SendMessage(hMainWnd, 1288 /*AKD_FRAMEFIND*/, 1 /*FWF_CURRENT*/, 0);
AkelPad.OpenFile(curDir + "\\" + newName, 0, AkelPad.GetEditCodePage(hWndEdit), AkelPad.GetEditBOM(hWndEdit));
lpFrame && AkelPad.SendMessage(hMainWnd, 1285 /*AKD_FRAMEACTIVATE*/, 0, lpFrame);
}
}
catch(e) {
AkelPad.MessageBox(
Expand Down

0 comments on commit 07f228e

Please sign in to comment.