pptx-note-remover icon indicating copy to clipboard operation
pptx-note-remover copied to clipboard

Monterey error app will no longer be supported

Open roland10pont opened this issue 3 years ago • 24 comments

Hi Andrew, I have been using this app for years but with the recent MacOS update I keep getting warnings that this app will no longer be supported in the future. Is this something that can be fixed?

roland10pont avatar Feb 06 '22 11:02 roland10pont

Same here. I would love an updated version!!

Filhgd avatar Apr 17 '22 10:04 Filhgd

Same here! Unfortunately the app's call to the /usr/bin/python interpreter is not supported anymore in MacO Monterey :-((

LaurieBayet avatar Apr 19 '22 19:04 LaurieBayet

Sorry for the delay -- it's been a very long time since I've had to bundle Python apps for macOS and a lot has changed. I've put together this new build: https://github.com/fongandrew/pptx-note-remover/raw/master/dist/drop_pptx_here.app.zip

Let me know if this works.

fongandrew avatar Sep 12 '22 05:09 fongandrew

First of all, thank you so much for this app that is very very useful. I tried the new version you posted above but it doesn't work. Trying to move the pptx file to the program nothing happens (actually it seems that it cannot be "dropped" on the program icon). Moreover, it seems that the app cannot run on the mac according to the icon appearing after the unzip of the file. icon

fcarrabs avatar Sep 24 '22 08:09 fcarrabs

I have similar issues with the new version. MacOS is complaining about the security issues linked to opening this app. When I provide permission I can drop a PPT file and it creates a new file but the new file cannot be opened by PowerPoint. Powerpoint does offer to repair the file.

roland10pont avatar Sep 24 '22 08:09 roland10pont

I have similar issues with the new version. MacOS is complaining about the security issues linked to opening this app. When I provide permission I can drop a PPT file and it creates a new file but the new file cannot be opened by PowerPoint. Powerpoint does offer to repair the file.

Even the original application does not work with the ppt files. Did you try with a pptx file?

fcarrabs avatar Sep 24 '22 14:09 fcarrabs

Yes I used PPT file. Drop it and it does create a second clean_copy but powerpoint cannot open the clean_copy

roland10pont avatar Sep 25 '22 03:09 roland10pont

I absolutely love this little app and would happily buy you a coffee or three if it can be successfully updated. The updated version in drop_pptx_here.app.zip at the moment brings up "You can’t open the application “drop_pptx_here” because this application is not supported on this Mac." on Monterey.

drleehw avatar Oct 05 '22 09:10 drleehw

Hi all, the script only works with PPTX files (not PPT). Please convert if possible.

The security issues are due to the app being unsigned. I'm trying to work my way through the notarization but it's a massive pain. In the meantime, does running it as an untrusted app (see https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac) work for anyone?

fongandrew avatar Oct 06 '22 03:10 fongandrew

Normally, an unsigned app makes the OS come up with a different message, to do with it being an unregistered developer. One can over-ride it in Security prefs pane. But that's not what's happening for me. The app icon actuallly has a 🚫 sign over it in grey. When I double click I get "You can’t open the application “drop_pptx_here” because this application is not supported on this Mac." That's not the message I usually get with apps from unsigned developers. I could be wrong, but it seems like a different issue to me.

drleehw avatar Oct 06 '22 11:10 drleehw

Are there any instructions anywhere on how to run the script from the command line? Would that still work? Personally, I'd find that very nearly as useful.

drleehw avatar Oct 06 '22 11:10 drleehw

Normally, an unsigned app makes the OS come up with a different message, to do with it being an unregistered developer. One can over-ride it in Security prefs pane. But that's not what's happening for me. The app icon actuallly has a 🚫 sign over it in grey. When I double click I get "You can’t open the application “drop_pptx_here” because this application is not supported on this Mac." That's not the message I usually get with apps from unsigned developers. I could be wrong, but it seems like a different issue to me.

Exactly the same situation occurs to me.

fcarrabs avatar Oct 06 '22 11:10 fcarrabs

Are there any instructions anywhere on how to run the script from the command line?

Yes, if you're comfortable with the command line:

  • Download this file: https://raw.githubusercontent.com/fongandrew/pptx-note-remover/master/drop_pptx_here.py
  • Open the macOS terminal
  • Navigate to wherever you downloaded the file
  • Run python3 drop_pptx_here.py path/to/your/file.pptx (replace the last arg with path to your own file obviously)

Troubleshooting steps:

  • python3 may be python on your system
  • If there are security issues with downloading the .py file, try copying the content and recreating the file using a plain text editor

fongandrew avatar Oct 06 '22 15:10 fongandrew

I worked my way around the security popups (following instructions) and dropped a PPTX file on the app. It did remove the comments BUT Powerpoint had to repair the -clean version of the PPTX file before it could open it. Seems powerpoint is unhappy about something in the -clean file.

Tried it on my M1 Macbook pro Monterey 12.6 and Microsoft Powerpoint 16.65, same result. App cleans the comments but the generated -clean file needs to be repaired by powerpoint before it opens.

roland10pont avatar Oct 07 '22 06:10 roland10pont

Thanks, Andrew. I ran it in a terminal window and it seemed to run OK, but then, like roland10pont, I got a message about repairing. Powerpoint couldn't repair the file. CleanShot 2022-10-07 at 08 08 50@2x CleanShot 2022-10-07 at 08 09 11@2x

drleehw avatar Oct 07 '22 07:10 drleehw

Are there any instructions anywhere on how to run the script from the command line?

Yes, if you're comfortable with the command line:

* Download this file: https://raw.githubusercontent.com/fongandrew/pptx-note-remover/master/drop_pptx_here.py

* Open the macOS terminal

* Navigate to wherever you downloaded the file

* Run `python3 drop_pptx_here.py path/to/your/file.pptx` (replace the last arg with path to your own file obviously)

Troubleshooting steps:

* `python3` may be `python` on your system

* If there are security issues with downloading the `.py` file, try copying the content and recreating the file using a plain text editor

This almost worked. I've stored your code in drop_pptx_here.py file but the code reports an error.

ourednik@computer python % python3 drop_pptx_here.py mypowerpoint.pptx
Processing mypowerpoint.pptx -- please wait.
. . . cleaning ppt/notesSlides/notesSlide45.xml
. . . cleaning ppt/notesSlides/notesSlide46.xml
. . . cleaning ppt/notesSlides/notesSlide47.xml
Press any key to quit.
Traceback (most recent call last):
  File "drop_pptx_here.py", line 31, in <module>
    main(fn)
  File "drop_pptx_here.py", line 16, in main
    data = old.read(item.filename).decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

This problem goes away if you explicitate that incorrect utf-8 sequences should be ignored on line 16:

        data = old.read(item.filename).decode('utf-8','ignore')

But the code currently destroys (removes references to) all images in the presentation. Any idea where this might come from?

aourednik avatar Nov 16 '22 11:11 aourednik

Using the latest build of the app (https://github.com/fongandrew/pptx-note-remover/raw/master/dist/drop_pptx_here.app.zip) yields the same problem as @drleehw and @roland10pont metion on my system. The "cleaning" happens, and the cleaned version opens, but all images are gone. Perhpas Microsoft changed the internal xml markup style of its pttx files and '<p:txBody>.*</p:txBody>' RegEx now catches more than it should?

aourednik avatar Nov 16 '22 11:11 aourednik

@aourednik (or anyone else) can you share a PPTX that's being corrupted by the cleaning process? I don't have access to MS Office these days and am testing with Google Slides, so likely I'm missing something.

fongandrew avatar Nov 16 '22 16:11 fongandrew

@aourednik (or anyone else) can you share a PPTX that's being corrupted by the cleaning process? I don't have access to MS Office these days and am testing with Google Slides, so likely I'm missing something.

Yes. This is the original file:

test.pptx

And this the corrupt version:

test-clean.pptx

If I change pptx to zip extension, extract and compare the folders, I see that many folders are missing in test-clean, notable test-clean/ppt/media/*. This must be the cause of the corruption.

But I think I have the solution. I've edited your python code. see https://github.com/fongandrew/pptx-note-remover/pull/2 This version works on my Apple M1 with Monterey. Can you verify and package the app @fongandrew ?

import zipfile
import os, sys
import re, tempfile

def rm_txt(str):
    return re.sub(r'<p:txBody>.*?<\/p:txBody>', '<p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr/></a:p></p:txBody>', str)

def main(fn):
    print("Processing %s -- please wait." % fn)
    if fn[-5:] != '.pptx':
        raise RuntimeError("Files need to be .pptx files.")
    fn2 = fn.replace(".pptx","-clean.pptx")
    with zipfile.ZipFile(fn, "r") as inzip, zipfile.ZipFile(fn2, "w") as outzip:
        for inzipinfo in inzip.infolist():
            with inzip.open(inzipinfo) as infile:
                if inzipinfo.filename.startswith("ppt/notesSlides/notesSlide") and inzipinfo.filename.endswith(".xml"):
                    data = infile.read().decode('utf-8','ignore')
                    print(". . .", "cleaning", inzipinfo.filename)
                    data = rm_txt(data)
                    outzip.writestr(inzipinfo.filename, data)
                else: 
                    outzip.writestr(inzipinfo.filename, infile.read())

if __name__ == '__main__':
    try:
        if len(sys.argv) > 1:
            for arg in sys.argv[1:]:
                fn = os.path.abspath(arg)
                main(fn)
                print("---")
        else:
            print("You need to drag your .pptx file(s) onto this one.")
    finally:
        input("Press any key to quit.")

aourednik avatar Nov 16 '22 21:11 aourednik

Thank you for the fix @aourednik. New bundle here: https://github.com/fongandrew/pptx-note-remover/raw/master/dist/drop_pptx_here.app.zip

Note that macOS will probably still complain about the app being unsigned but if you can get it running as untrusted, it'll probably work.

fongandrew avatar Nov 18 '22 05:11 fongandrew

@aourednik One oddity is that when I run the script on your test file, the "clean" file is actually slightly larger? But the notes are gone. 🤷 Might be some strange weirdness with the compression.

fongandrew avatar Nov 18 '22 05:11 fongandrew

@aourednik One oddity is that when I run the script on your test file, the "clean" file is actually slightly larger? But the notes are gone. 🤷 Might be some strange weirdness with the compression.

Yep, I've also noticed the native microsoft compression of the pptx files is some weird variant of the zip algorithm. The standard unarchiving utility of MacOS cannot deal with it, but Keka can, as well as the python zipfile module. But everything else seems allright

aourednik avatar Nov 18 '22 13:11 aourednik

Thank you for the fix @aourednik. New bundle here: https://github.com/fongandrew/pptx-note-remover/raw/master/dist/drop_pptx_here.app.zip

Note that macOS will probably still complain about the app being unsigned but if you can get it running as untrusted, it'll probably work.

True. MacOS security obsessions... (though, I guess, better a couple of more clicks than having a computer infested with malware like Windows machines)

For other users in this thread:

  1. Double-click on the drop_pptx_here.app icon
  2. MacOS will complain. Just click "OK"
  3. Click the apple sympbol in the upper left corner of your screen
  4. Choose "Sytem Preferences"
  5. Go to "Seucrity and Confidentiality"
  6. Click "Open Anyway" (or whatever the button is named in your language)
  7. A popup window will appear. Click "Open".
image

aourednik avatar Nov 18 '22 13:11 aourednik

I've put in a request for Apple to notarize the app, so hopefully you don't have to go into System Preferences, but that may take a little while.

fongandrew avatar Nov 18 '22 15:11 fongandrew