Jump to content

zeitlings

Member
  • Posts

    187
  • Joined

  • Last visited

  • Days Won

    12

Reputation Activity

  1. Like
    zeitlings reacted to luckman212 in Showing Script filter icon at the top right of Alfred's window   
    @zeitlings I finally got it. Yes, I see your technique - very clever! Thanks for the tip.
  2. Like
    zeitlings got a reaction from TomBenz in Extract Keywords   
    Hey @TomBenz, that sounds like a job for a different workflow and somewhat niche.
    If you want to adapt the workflow to do that, I'd start with passing (a) the text file location $loc and (b) the keywords, i.e. the query as $1 for zsh argv to a “Run Script” object that runs your python script.
     
    The script should look something like this (not at all tested):
     
    import os.path import sys from docx import Document from docx.enum.text import WD_COLOR_INDEX from nltk.tokenize import sent_tokenize filename = sys.argv[1] keywords = sys.argv[2] search_words = keywords.splitlines() matches = [] sentences = sent_tokenize(text) for word in search_words: for sentence in sentences: if word in sentence: matches.append(sentence) doc = Document(filename) for para in doc.paragraphs: for items in matches: start = para.text.find(items) if start > -1: pre = para.text[:start] post= para.text[start+len(items):] para.text = pre para.add_run(items) para.runs[1].font.highlight_color = WD_COLOR_INDEX.YELLOW para.add_run(post) # Save the output in new doc file at selected file location root, extension = os.path.splitext(filename) output_filename = root + "_KeySent_Highlights_C1" + extension doc.save(output_filename) sys.stdout.write(output_filename) # e.g. to reveal the file with Alfred  
  3. Like
    zeitlings reacted to giovanni in alfred-hubHub – A customizable Alfred hub for your GitHub repositories   
    you are right, @zeitlings, thanks for spotting! That does look like a bug in the API. 
    Should be fixed in the latest release.
  4. Like
    zeitlings got a reaction from giovanni in alfred-hubHub – A customizable Alfred hub for your GitHub repositories   
    I just noticed that the watchers count is identical to the stargazers count (cf. your screenshot). I checked your code and some Github API responses and it looks like all is fine. 
    So, is this intended? I expected to find the number of people actually watching a repository:  
    That seems to be reflected in the key subscribers_count rather than watchers_count for whatever reason.
     
    # simply changing the key panics for me # I see it via `curl ... "https://api.github.com/repos/{OWNER}/{REPO}"` though myGithubHub [myRepo["name"]]['myWatchers'] = myRepo['subscribers_count']  
     
  5. Like
    zeitlings got a reaction from Floating.Point in Do Slower Part of the Script Later in Script Filter   
    You may want to have a look at the "rerun" key.
     
     
    On the first run, return the results that are loaded quickly, immediately rerun, then execute the slow script and return the results. If the Alfred window is still open, the first results will be replaced. (You could pass a variable that acts as a token to indicate that the slow script should be run now).
  6. Like
    zeitlings reacted to mayuzumi in ImmeGPT — Yet another ChatGPT Workflow for Alfred   
    Installation:
    You can install the workflow from the releases page at the workflow Github repo.
     
     
    Description & Sceenshots:
    The free ChatGPT api is from https://chat.aizs.eu.org
     

  7. Like
    zeitlings got a reaction from cands in Extract Keywords   
    Extract Keywords
    Extract keywords and keyphrases from articles, books or any other document with YAKE!
     

     
     
    Usage
    Send PDF, docx, doc, rtf or txt documents to the workflow’s File Actions Pass the text from your selection in macOS on to the workflow’s Universal Action Use the keyword and paste your text (default: kw) 
    The extracted keywords are presented in a dialog.

    Dependencies
    The workflow relies on Python3 to install the YAKE standalone.
    YAKE!
    pip install git+https://github.com/LIAAD/yake  official installation guide
    pdftotext
    brew install poppler  formula on brew.sh
    Stopwords
     

    Yake has internal stopword handling that cannot be influenced from the command line. However, you can still define a list of words that will be flat out purged from the input text. To set up a ‘purge word’-list, create a text file named as the language identifier for a corresponding language in the workflow root folder: assets/stopwords/de.txt.

    The workflow checks if the file exists and if it does, the words are removed.

    The purge-word files can be quickly accessed through Alfred by prefixing the keyword with a colon (default: :kw).



    YAKE! is a light-weight unsupervised automatic keyword extraction method which rests on text statistical features extracted from single documents to select the most important keywords of a text.
  8. Like
    zeitlings reacted to pseudometa in Reddit Browser   
    Features
    - Browse subreddits, switch between subreddits.
    - No reddit account needed. 
    - Save scrolling positions, mark posts as new, old or visited.
    - Can also browse hackernews.
    - Minimum upvotes to display posts, customizable sorting method.
    - Optionally open posts in old reddit.
    - Due to smart caching, this workflow should never hit API rate limits (under normal usage).
     
    ➡️ Download: https://github.com/chrisgrieser/alfred-reddit-browser/releases/latest





  9. Like
    zeitlings reacted to giovanni in alfred-hubHub – A customizable Alfred hub for your GitHub repositories   
    alfred-hubHub – A customizable Alfred hub for your GitHub repositories
     
    author: @giovanni
    Alfred Forum
    GitHub
    Dependencies (bundled): requests; optional: pandas, matplotlib

  10. Like
    zeitlings reacted to pseudometa in PDF summarizer   
    Get summaries of your PDFs via ChatPDF with just one hotkey.
     
    Requires a ChatPDF API key, which is (currently) free for 5000 PDF pages / 500 requests per month.
     
    ➡️ https://github.com/chrisgrieser/pdf-summarizer-alfred

  11. Like
    zeitlings got a reaction from poirpom in Color Picker   
    Pick a color to get its hex, rgba, hsl representation or NSColor initializer.
     

    Usage
    Activate the Color Sampler with the keyword (default: cp) and pick the desired color.

    Color History
    To review previously picked colors, activate the workflow with the keyword preceded by a colon (default: :cp).
  12. Like
    zeitlings got a reaction from TomBenz in Extract Keywords   
    Extract Keywords
    Extract keywords and keyphrases from articles, books or any other document with YAKE!
     

     
     
    Usage
    Send PDF, docx, doc, rtf or txt documents to the workflow’s File Actions Pass the text from your selection in macOS on to the workflow’s Universal Action Use the keyword and paste your text (default: kw) 
    The extracted keywords are presented in a dialog.

    Dependencies
    The workflow relies on Python3 to install the YAKE standalone.
    YAKE!
    pip install git+https://github.com/LIAAD/yake  official installation guide
    pdftotext
    brew install poppler  formula on brew.sh
    Stopwords
     

    Yake has internal stopword handling that cannot be influenced from the command line. However, you can still define a list of words that will be flat out purged from the input text. To set up a ‘purge word’-list, create a text file named as the language identifier for a corresponding language in the workflow root folder: assets/stopwords/de.txt.

    The workflow checks if the file exists and if it does, the words are removed.

    The purge-word files can be quickly accessed through Alfred by prefixing the keyword with a colon (default: :kw).



    YAKE! is a light-weight unsupervised automatic keyword extraction method which rests on text statistical features extracted from single documents to select the most important keywords of a text.
  13. Thanks
    zeitlings reacted to xilopaint in AlfredOCR - Optical Character Recognition   
    I just tried with a second file. This time the process has been completed with the “Word Granularity” strategy but the OCR quality with "Line Oriented" is way better.
     
     
    It doesn't matter. After clearing the cache I always face the same issue with “Word Granularity” if I run the workflow with the first PDF file.
  14. Like
    zeitlings got a reaction from cands in DEVONthink Portal   
    Hey @Epitome, the issue was introduced with a dt3 update a while ago. Other than that, I've been using the workflow quite constantly myself without issues. 
    I've just uploaded an updated version that should work for you, hopefully. Let me know how it works out for you!
     
    Among numerous internal changes, some things are new, e.g.
    Import Memory - Groups previously selected for importing are remembered (configurable) Document Filters (Globally and per Database. Accessible via dvn .) Today (files worked on today) Recently Modified Recently Added Due Soon Overdue If a document is locked, it is indicated using Apple's SF Symbols. These may need to be installed. Internal configuration via dvn :c  
    V1.0.0 Release 🎉
  15. Like
    zeitlings got a reaction from addEdgeBookmarkSearch in How to change a Finder window's "Sort By" option in workflow?   
    Finder's scripting definitions seem to allow for sorting (so no GUI scripting, but AppleScript nonetheless).
     
     
    You can see the documentation via Script Editor (App), File > Open Dictionary (⇧⌘O) > Finder (from the list). 
    By the by, Vitor has a neat workflow to open AppleScript Dictionaries.
  16. Like
    zeitlings reacted to Epitome in DEVONthink Portal   
    Incredible! Thank you so much, it works perfectly now. I haven't had a chance to play with all the features yet, so far though it seems really well thought out. Looking forward to seeing what it can do!
  17. Like
    zeitlings got a reaction from xilopaint in Set Default Browser   
    Sure, why not 😄
     
    v1.3.0
    - Added browser selection to workflow configuration 
     
  18. Like
    zeitlings reacted to spongeblink in Do Slower Part of the Script Later in Script Filter   
    Thank you so much for modifying my code! 👍👍 Than's exactly how I would like it to work!
     
    Looked at my original code and found out that the quick part does not trigger a rerun of itself to let user_prompt and former_user_prompt sync since os.getenv("former_user_prompt") == os.getenv("user_prompt") is no longer true. 
     
    Your solution is way better! Thanks in advance!
  19. Thanks
    zeitlings got a reaction from spongeblink in Do Slower Part of the Script Later in Script Filter   
    This seems to do the trick:
    #!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import os import sys import uuid import time def get_query() -> str: """Join the arguments into a query string.""" return " ".join(sys.argv[1:]) def provide_history(): """Provide the history of the user.""" prompt = get_query() if os.getenv("did_rerun") is None or (prompt != os.getenv("former_user_prompt")): uuid_ = str(uuid.uuid1()) pre_history_dict = { "variables": { "former_user_prompt": prompt, "did_rerun": True }, "rerun": 0.1, "items": [ { "type": "default", "title": prompt, "subtitle": f"Talk to {prompt} 💬".strip(), "arg": [uuid_, prompt], "autocomplete": "prompt", } ], } sys.stdout.write(json.dumps(pre_history_dict)) else: #slow part time.sleep(1) response_dict = { "variables": { "former_user_prompt": prompt, }, "items": [ { "type": "default", "title": "slow part", "subtitle": f"Talk to {prompt} 💬".strip(), "arg": [os.getenv("uuid_"), prompt], "autocomplete": prompt, } ], } sys.stdout.write(json.dumps(response_dict)) provide_history()  

  20. Like
    zeitlings reacted to mgguinne in Request: Telegram   
    Yes, there is now a really good API, and someone could write an Alfred workflow (that's not me), I am sending my Telegram messages via bash scripts currently and it works well.
     
    https://core.telegram.org/bots/api#available-methods
  21. Like
    zeitlings got a reaction from spongeblink in Do Slower Part of the Script Later in Script Filter   
    You may want to have a look at the "rerun" key.
     
     
    On the first run, return the results that are loaded quickly, immediately rerun, then execute the slow script and return the results. If the Alfred window is still open, the first results will be replaced. (You could pass a variable that acts as a token to indicate that the slow script should be run now).
  22. Like
    zeitlings got a reaction from vitor in Setting keyword *within* a workflow   
    That should be possible with the Script Filter utility. However, that strikes me as an unnecessarily verbose approach.
    Why don't you just open the default Alfred launcher (opt+space or whatever you have configured) and search for the app you want by name? 
    If you want to browse folders, you type "/". To search folders, you could map a file filter to a leading key, say, "f" and have it only search for folders.
  23. Like
    zeitlings got a reaction from vitor in How to change a Finder window's "Sort By" option in workflow?   
    Finder's scripting definitions seem to allow for sorting (so no GUI scripting, but AppleScript nonetheless).
     
     
    You can see the documentation via Script Editor (App), File > Open Dictionary (⇧⌘O) > Finder (from the list). 
    By the by, Vitor has a neat workflow to open AppleScript Dictionaries.
  24. Like
    zeitlings got a reaction from andy4222 in Heads-up Display   
    @andy4222 The recommended way is to use SPM (Swift Package Manager). However, I quickly tested a minimal-effort approach that works. You can compile the script as is without changing anything about the code. 
     
    Navigate to HUD.swift with your terminal (or open the Workflow in Alfred, double-click any of the two objects, then click the little folder icon in the bottom left corner to open the location, select HUD.swift and send it to Alfred’s Universal Action (opt+cmd+#). From the options, choose “Open Terminal Here”.
     
    In the terminal that opens paste and run this to create the executable at the same location.
    swiftc -O HUD.swift  
    In the workflow, open the "Run Script" object and replace 
    ./HUD.swift "$1" 250  
    with
    ./HUD "$1" 250  
    Voilà.
  25. Like
    zeitlings got a reaction from andy4222 in Heads-up Display   
    Or better yet, just replace the contents of the "Run Script" object with this:
     
    [[ -f ./HUD ]] || eval $(swiftc -O ./HUD.swift) ./HUD "$1" 250  
    If the executable does not exist yet, it will be created and then called.
×
×
  • Create New...