xilopaint Posted January 5, 2023 Author Share Posted January 5, 2023 18 minutes ago, 2pilvic said: The flow stopped working for me and I don't know what could have happened. I reinstalled macOs and it hasn't worked since. The mistake is: ERROR: Alfred PDF Tools[Run Script] xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun The /Library/Developer/CommandLineTools/usr/ folder only contains the “share” and “lib” folders I'd appreciate your help You just need to install Command Line Tools. Run this command in Terminal: xcode-select --install Link to comment
2pilvic Posted January 5, 2023 Share Posted January 5, 2023 1 hour ago, xilopaint said: You just need to install Command Line Tools. Run this command in Terminal: xcode-select --install It is done. All in order. Many thanks xilopaint 1 Link to comment
TomBenz Posted January 6, 2023 Share Posted January 6, 2023 17 hours ago, xilopaint said: Could you explain further how the feature would work and why you need it? Would the text file be a simple .txt file? It is extraction of pdf bookmarks into text and excel file with same filename with bookmark as suffix. I posted Python code for it in a separate thread and have been able to make it work via Alfred. When I am reading large technical pdf document, I extract bookmark into excel, allocate time to topics, exercises and then work on the document. I also take some notes if needed in excel file. Link to comment
xilopaint Posted January 6, 2023 Author Share Posted January 6, 2023 14 hours ago, TomBenz said: It is extraction of pdf bookmarks into text and excel file with same filename with bookmark as suffix. I posted Python code for it in a separate thread and have been able to make it work via Alfred. When I am reading large technical pdf document, I extract bookmark into excel, allocate time to topics, exercises and then work on the document. I also take some notes if needed in excel file. Where's the code? Link to comment
TomBenz Posted January 7, 2023 Share Posted January 7, 2023 7 hours ago, xilopaint said: Where's the code? import sys query = sys.argv[1] sys.stdout.write(query) print(query) filename = query # -*- coding: utf-8 -*- """ Created on Mon Jan 2 13:45:57 2023 @author: khale """ #Extract bookmark from PDF and export to excel # openpyxl and PyMuPDF are needed from openpyxl import Workbook import fitz import os import subprocess, platform doc = fitz.open(filename) toc = doc.get_toc() if len(toc) >0 : wb = Workbook() ws = wb.active ws.title = "Bookmarks" ws.cell(1,1).value= "Bookmark" ws.cell(1,2).value= "Pages" for i in range(0, len(toc)): ws.cell(i+2,1).value =toc[1] ws.cell(i+2,2).value =toc[2] Bookmark_filename = filename[:-4] +" BookMark.xlsx" wb.save(Bookmark_filename) #Open excel #os.system(f'start excel.exe "{Bookmark_filename}"') if platform.system() == 'Darwin': # macOS subprocess.call(('open', Bookmark_filename)) elif platform.system() == 'Windows': # Windows os.startfile(Bookmark_filename) else: # linux variants subprocess.call(('xdg-open', Bookmark_filename)) else: #No bookmark in the PDF print("no Bookbark was found") Link to comment
xilopaint Posted January 7, 2023 Author Share Posted January 7, 2023 @TomBenzthis workflow is intended to cover broad PDF manipulation needs. With that in mind, I avoid implementing features that are too specific and therefore cannot be leveraged by a large user base. Anyway, I'm happy to know you were able to make the script work via Alfred. TomBenz 1 Link to comment
xilopaint Posted January 13, 2023 Author Share Posted January 13, 2023 17 hours ago, Yoyontzin said: How do I install it? You can download it from the GitHub releases page: https://github.com/xilopaint/alfred-pdf-tools/releases/latest Link to comment
chumido Posted March 29, 2023 Share Posted March 29, 2023 (edited) @xilopaint Hi. I runed optimize command and get the failed notification. Can you please check and help me to fix: Info: Workflow version 4.2 Alfred version 5.0.6 Python version 3.11.2 PyCryptodome version Not Installed macOS version 13.3 Architecture i386 Debug: [16:56:19.805] Alfred PDF Tools[File Action] Processing complete [16:56:19.809] Alfred PDF Tools[File Action] Passing output '/Users/chumido/Dropbox/Mac/Downloads/Tài liệu kết nối APi TMDT (5).pdf' to Arg and Vars [16:56:19.810] Alfred PDF Tools[Arg and Vars] Processing complete [16:56:19.811] Alfred PDF Tools[Arg and Vars] Passing output '' to Keyword [16:56:25.339] Alfred PDF Tools[Keyword] Processing complete [16:56:25.344] Alfred PDF Tools[Keyword] Passing output '50' to Replace [16:56:25.346] Alfred PDF Tools[Replace] Processing complete [16:56:25.347] Alfred PDF Tools[Replace] Passing output '50' to Run Script [16:56:25.962] STDERR: Alfred PDF Tools[Run Script] . 16:56:25 workflow.py:2278 DEBUG ---------- Alfred PDF Tools (4.2.0) ---------- 16:56:25 workflow.py:1681 DEBUG reading settings from /Users/chumido/Library/Application Support/Alfred/Workflow Data/com.xilopaint.alfredapp.pdftools/settings.json 16:56:25 workflow.py:2683 DEBUG update check not due 16:56:25 workflow.py:1904 DEBUG loading cached data: /Users/chumido/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.xilopaint.alfredapp.pdftools/__workflow_latest_version.pickle 16:56:25 workflow.py:2609 DEBUG set last run version: 4.2.0 16:56:25 workflow.py:2322 DEBUG ---------- finished in 0.299s ---------- Edited March 29, 2023 by chumido Link to comment
xilopaint Posted March 29, 2023 Author Share Posted March 29, 2023 @chumido Could you send me the PDF file you used via PM? Link to comment
xilopaint Posted March 30, 2023 Author Share Posted March 30, 2023 @chumido your file works for me. Did you remember to allow k2pdfopt in System Settings? Link to comment
chumido Posted March 30, 2023 Share Posted March 30, 2023 3 minutes ago, xilopaint said: @chumido your file works for me. Did you remember to allow k2pdfopt in System Settings? It did not show in system setting when i runed command. just a notification said failed. Maybe i miss something? Link to comment
xilopaint Posted March 30, 2023 Author Share Posted March 30, 2023 (edited) 2 minutes ago, chumido said: It did not show in system setting when i runed command. just a notification said failed. Maybe i miss something? Delete the workflow, install it again and run the Optimize File Action in your file. Edited March 30, 2023 by xilopaint Link to comment
chumido Posted March 30, 2023 Share Posted March 30, 2023 (edited) 3 minutes ago, xilopaint said: Delete the workflow, install it again and run the Optimize File Action in your file. I have just tried, but I am still getting that error. Edited March 30, 2023 by chumido add more infos Link to comment
xilopaint Posted March 30, 2023 Author Share Posted March 30, 2023 1 minute ago, chumido said: I have just tried, but I am still getting that error. Have you seen the message in System Settings this time? Link to comment
chumido Posted March 30, 2023 Share Posted March 30, 2023 (edited) 5 minutes ago, xilopaint said: Have you seen the message in System Settings this time? No its not. There is no message. Weird. Edited March 30, 2023 by chumido Link to comment
xilopaint Posted March 30, 2023 Author Share Posted March 30, 2023 (edited) 6 hours ago, chumido said: No its not. There is no message. Weird. This file action executes an unsigned binary. You should see the message. Any idea why he can't see the message, @vitor? Edited March 30, 2023 by xilopaint Link to comment
xilopaint Posted March 30, 2023 Author Share Posted March 30, 2023 @chumido do you have the same issue with other PDF files? Link to comment
chumido Posted March 30, 2023 Share Posted March 30, 2023 5 minutes ago, xilopaint said: @chumido do you have the same issue with other PDF files? i tried about 10-15 pdf files, and all of them have this issue. Link to comment
chumido Posted March 30, 2023 Share Posted March 30, 2023 Only optimize command has error. The other work perfect. Link to comment
xilopaint Posted April 24, 2023 Author Share Posted April 24, 2023 Update (v4.3) Replace PyPDF2 with pypdf. Update Notificator. Improve flow for PyCryptodome installation. Link to comment
xilopaint Posted May 6, 2023 Author Share Posted May 6, 2023 (edited) Update (v4.3.1) Fixed bugs in workflow objects. Edited May 6, 2023 by xilopaint Link to comment
slyfox Posted July 6, 2023 Share Posted July 6, 2023 How do I bypass the security warning? A click allow anyway multiple times and still get the same error when trying to merge PDF files. Link to comment
xilopaint Posted July 6, 2023 Author Share Posted July 6, 2023 (edited) @slyfoxTo get support you need to post the !diagnostic keyword output. Edited July 6, 2023 by xilopaint Link to comment
slyfox Posted July 7, 2023 Share Posted July 7, 2023 23 hours ago, xilopaint said: @slyfoxTo get support you need to post the !diagnostic keyword output. Diagnostic: https://pastebin.com/bPRcfxUD Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now