Tagged: git

3-way merge of PowerPoint with git

This doesn’t work for some reason, but I’ll make a note and look at it later. On the Mac’s Script Editor, the dictionary for MS PowerPoint 2011 says it has a method called mergeWithBaseline. That sounds like a 3-way merge. This is a sketch of what the code should look like. For some reason I can’t get mergeWithBaseline to do anything.

#!bash
# pptmerge LOCAL REMOTE BASE MERGED
osascript -l JavaScript << EOF
PPT = Application("Microsoft PowerPoint");
PPT.activate()
local = Path($1)
PPT.open(local)
PPT.activeWindow.presentation.mergeWithBaseline({withRevisionPath: $2, withBaselinePath: $3})
PPT.activeWindow.presentation.endReview()
PPT.save({in: $4, as: "save as presentation"})
PPT.quit()
EOF

In the .gitconfig there should be something like this:

[mergetool "powerpoint"]
    cmd = pptmerge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

It looks like you can select different merge tools with “git mergetool –tool=powerpoint fileName”. Is there a way to trigger this by file extensions (.pptx)?