Giter Site home page Giter Site logo

Comments (24)

LaurieBayet avatar LaurieBayet commented on July 19, 2024 1

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

from pptx-note-remover.

fongandrew avatar fongandrew commented on July 19, 2024 1

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

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

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

from pptx-note-remover.

aourednik avatar aourednik commented on July 19, 2024 1

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

from pptx-note-remover.

Filhgd avatar Filhgd commented on July 19, 2024

Same here. I would love an updated version!!

from pptx-note-remover.

fongandrew avatar fongandrew commented on July 19, 2024

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.

from pptx-note-remover.

fcarrabs avatar fcarrabs commented on July 19, 2024

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

from pptx-note-remover.

roland10pont avatar roland10pont commented on July 19, 2024

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.

from pptx-note-remover.

fcarrabs avatar fcarrabs commented on July 19, 2024

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?

from pptx-note-remover.

roland10pont avatar roland10pont commented on July 19, 2024

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

from pptx-note-remover.

drleehw avatar drleehw commented on July 19, 2024

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.

from pptx-note-remover.

fongandrew avatar fongandrew commented on July 19, 2024

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?

from pptx-note-remover.

drleehw avatar drleehw commented on July 19, 2024

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.

from pptx-note-remover.

drleehw avatar drleehw commented on July 19, 2024

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.

from pptx-note-remover.

fcarrabs avatar fcarrabs commented on July 19, 2024

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.

from pptx-note-remover.

roland10pont avatar roland10pont commented on July 19, 2024

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.

from pptx-note-remover.

drleehw avatar drleehw commented on July 19, 2024

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

from pptx-note-remover.

aourednik avatar aourednik commented on July 19, 2024

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?

from pptx-note-remover.

aourednik avatar aourednik commented on July 19, 2024

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?

from pptx-note-remover.

fongandrew avatar fongandrew commented on July 19, 2024

@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.

from pptx-note-remover.

aourednik avatar aourednik commented on July 19, 2024

@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 #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.")

from pptx-note-remover.

fongandrew avatar fongandrew commented on July 19, 2024

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.

from pptx-note-remover.

fongandrew avatar fongandrew commented on July 19, 2024

@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.

from pptx-note-remover.

aourednik avatar aourednik commented on July 19, 2024

@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

from pptx-note-remover.

fongandrew avatar fongandrew commented on July 19, 2024

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.

from pptx-note-remover.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.