2 // TortoiseSVN Diff script for Powerpoint files
\r
4 // Copyright (C) 2004-2008 the TortoiseSVN team
\r
5 // This file is distributed under the same license as TortoiseSVN
\r
9 // $Date: 2008-06-13 21:52:53 +0800 (Fri, 13 Jun 2008) $
\r
17 This script starts PowerPoint and compares the two given presentations.
\r
18 To better see the changes and get the highlighting feature of PowerPoint
\r
19 click on "Apply all changes to the presentation" on the reviewing toolbar.
\r
21 var objArgs,num,sBasePpt,sNewPpt,objScript,powerpoint,source;
\r
23 objArgs = WScript.Arguments;
\r
24 num = objArgs.length;
\r
27 WScript.Echo("Usage: [CScript | WScript] diff-ppt.js base.ppt new.ppt");
\r
31 sBasePpt = objArgs(0);
\r
32 sNewPpt = objArgs(1);
\r
34 objScript = new ActiveXObject("Scripting.FileSystemObject");
\r
35 if ( ! objScript.FileExists(sBasePpt))
\r
37 WScript.Echo("File " + sBasePpt + " does not exist. Cannot compare the presentations.");
\r
40 if ( ! objScript.FileExists(sNewPpt))
\r
42 WScript.Echo("File " + sNewPpt +" does not exist. Cannot compare the presentations.");
\r
50 powerpoint = WScript.CreateObject("Powerpoint.Application");
\r
54 WScript.Echo("You must have Microsoft Powerpoint installed to perform this operation.");
\r
58 powerpoint.visible = true;
\r
60 // Open the original (base) document
\r
61 source = powerpoint.Presentations.Open(sBasePpt);
\r
63 // Merge the new document, to show the changes
\r
64 source.Merge(sNewPpt);
\r
66 // Mark the comparison presentation as saved to prevent the annoying
\r
67 // "Save as" dialog from appearing.
\r
68 powerpoint.ActivePresentation.Saved = 1;
\r