OSDN Git Service

BrowseRefs: Initial branch selection also possible with partial ref-name
[tortoisegit/TortoiseGitJp.git] / contrib / other / diff-scripts / diff-ppt.js
1 //\r
2 // TortoiseSVN Diff script for Powerpoint files\r
3 //\r
4 // Copyright (C) 2004-2008 the TortoiseSVN team\r
5 // This file is distributed under the same license as TortoiseSVN\r
6 //\r
7 // Last commit by:\r
8 // $Author: luebbe $\r
9 // $Date: 2008-06-13 21:52:53 +0800 (Fri, 13 Jun 2008) $\r
10 // $Rev: 13247 $\r
11 //\r
12 // Authors:\r
13 // Arne Moor, 2006\r
14 //\r
15 \r
16 /*\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
20 */\r
21 var objArgs,num,sBasePpt,sNewPpt,objScript,powerpoint,source;\r
22 \r
23 objArgs = WScript.Arguments;\r
24 num = objArgs.length;\r
25 if (num < 2)\r
26 {\r
27    WScript.Echo("Usage: [CScript | WScript] diff-ppt.js base.ppt new.ppt");\r
28    WScript.Quit(1);\r
29 }\r
30 \r
31 sBasePpt = objArgs(0);\r
32 sNewPpt = objArgs(1);\r
33 \r
34 objScript = new ActiveXObject("Scripting.FileSystemObject");\r
35 if ( ! objScript.FileExists(sBasePpt))\r
36 {\r
37     WScript.Echo("File " + sBasePpt + " does not exist.  Cannot compare the presentations.");\r
38     WScript.Quit(1);\r
39 }\r
40 if ( ! objScript.FileExists(sNewPpt))\r
41 {\r
42     WScript.Echo("File " + sNewPpt +" does not exist.  Cannot compare the presentations.");\r
43     WScript.Quit(1);\r
44 }\r
45 \r
46 objScript = null;\r
47 \r
48 try\r
49 {\r
50    powerpoint = WScript.CreateObject("Powerpoint.Application");\r
51 }\r
52 catch(e)\r
53 {\r
54    WScript.Echo("You must have Microsoft Powerpoint installed to perform this operation.");\r
55    WScript.Quit(1);\r
56 }\r
57 \r
58 powerpoint.visible = true;\r
59 \r
60 // Open the original (base) document\r
61 source = powerpoint.Presentations.Open(sBasePpt);\r
62     \r
63 // Merge the new document, to show the changes\r
64 source.Merge(sNewPpt);\r
65     \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