xilopaint / alfred-pdf-tools

Optimize, encrypt and manipulate PDF files.
MIT License
149 stars 10 forks source link

Alfred PDF Tools didn't work for me... #26

Closed MartinLau42 closed 1 year ago

MartinLau42 commented 1 year ago

Describe the bug I have tried using "Encrypt", "Merge", "Split by Page Count", "Slice in Multiple Files" via Alfred action, but nothing happened. I did understand it utilizes action instead of keywords, and I didn't change anything as well. I have also tried using different PDFs, still nothing happened.

To reproduce I searched the PDF I wanted to apply action to via Alfred file search, then by pressing ^ (i.e. control key) towards the selected PDF to trigger the action, choosing specific actions mentioned above, then press "enter / return" on it, sadly nothing happened. All the workflow actions mentioned above gave the same ERROR message below.

Debugger information ERROR: Alfred PDF Tools[Run Script] Traceback (most recent call last): File "alfred_pdf_tools.py", line 125, in def optimize(resolution: str, pdf_paths: list[str]) -> None: TypeError: 'type' object is not subscriptable

Troubleshooting Information:

Workflow version

4.5

Alfred version

5.1.1

Python version

3.7.3

PyCryptodome version

Not Installed

Rosetta installation status

Not Installed

macOS version

13.5

Architecture

i386

Screenshots error

xilopaint commented 1 year ago

You're running the workflow on an old Python version. You can install a newer Python version by running brew install python on Terminal.

MartinLau42 commented 1 year ago

Many thanks for such an amazing workflow you have made!

After updating the Python to the latest version, I successfully run all the actions but "Optimize" and "Deskew" because of the following error:

error-of-optimize-and-deskew

error_continue

xilopaint commented 1 year ago

You're running the workflow on an Intel Mac, and those two actions are officially compatible with Apple Silicon only. As a workaround, you can replace the k2pdfopt file with its i386 version (x86), which you can download from here. Each time you update the workflow to a new version, you'll need to do it again.

The i386 architecture can be supported in the future if someone creates a Homebrew formula for k2pdfopt.

MartinLau42 commented 1 year ago

Fixed! Thank you so much!