Comment 4 for bug 302050

Revision history for this message
zzarko (zzarko-gmail) wrote :

I have the same problem (I'm no longer able to open pps in edit mode) and I solved it with this script. It's brute-force solution (temporarily renames pps to ppt), but it works.
----------------SCRIPT----------------
#!/bin/bash
#script to open pps files in edit mode in Ubuntu
#script contains code found on several places on the internet and can handle only one parameter (file)

fullpath=$1
filename="${fullpath##*/}" # Strip longest match of */ from start
dir="${fullpath:0:${#fullpath} - ${#filename}}" # Substring from 0 thru pos of filename
base="${filename%.[^.]*}" # Strip shortest match of . plus at least one non-dot char from end
ext="${filename:${#base} + 1}" # Substring from len of base thru end
if [[ -z "$base" && -n "$ext" ]]; then # If we have an extension and no base, it's really the base
    base=".$ext"
    ext=""
fi
extnew=$ext
if [ "$ext" == "pps" ] || [ "$ext" == "PPS" ]; then
 extnew="ppt"
fi
if [ "$dir" == "" ]; then
 dir="."
fi
oldname="$dir/$filename"
newname="$dir/$base.$extnew"
mv "$oldname" "$newname"
ooimpress "$newname"
mv "$newname" "$oldname"
----------------SCRIPT----------------
Save it as ooimpress-noshow, do
chmod a+x ooimpress-noshow
and open your pps files with it. You can change association globally (from Properties on pps file), or (probably better) just for some programs in their local preferences (Thunderbird, Firefox, ...).