Jump to content

zeitlings

Member
  • Posts

    178
  • Joined

  • Last visited

  • Days Won

    11

Reputation Activity

  1. Like
    zeitlings reacted to vitor in Keyboard Brightness   
    You can do it by following these instructions, except you’ll use a Hotkey Trigger instead of a Remote Trigger. And instead of setting the text to fast-forward or play-pause, use keyboard-brightness-up and keyboard-brightness-down.
  2. Like
    zeitlings reacted to Stephen_C in Configuration Builder Improvements   
    I think this would be useful.
     
    Stephen
  3. Like
    zeitlings reacted to dood in Alfred Google Inline Results   
    A word to the wise: you can easily modify this workflow to work with DuckDuckGo.
     
    1. Install ddgr via Homebrew (from the same developer as googlr)
     
    2. Download the Alfred Googler workflow mentioned above
     
    3. Open the workflow in Finder, and in the "google_instant.rb" file, change
    results = Lightly.new(life: '4h').get query do JSON.parse `/usr/local/bin/googler --json -n 9 #{query}` end  
    to:
    results = Lightly.new(life: '4h').get query do JSON.parse `/usr/local/bin/ddgr --json -n 9 #{query}` end
  4. Like
    zeitlings reacted to pseudometa in Nerdfont support   
    Among frequent terminal users, the nerdfonts are becoming increasingly popular since they add icons to an application that otherwise does not support images.
     
    I was thinking, that they might also be a great addition for Alfred, too. They are an easy way to add icons to your workflows or web searches. While it is possible to use a nerdfont via Alfred theme settings, this has the disadvantage that this only works for your own device (i.e. not usable for workflows you publish for others), and in the Alfred UI those nerdfonts are still question-mark-boxes or linestracks (), making it hard to use them really.
     
    What some terminal emulators like WezTerm do is adding the nerdfont icons as a fallback symbol font, meaning that if the user uses a font that does not include the nerdfont icons, it automatically falls back to the symbol font. That way, users can still use their preferred font, don't have to fiddle with patching a font file, and still get nice icons. (css font stacks work the same way, if I remember correctly.) I think a similar approach could also make sense for Alfred.
     
    See here an example where I am using a nerd font to display some icons in Alfred:

  5. Like
    zeitlings reacted to sepulchra in apple mail and markdown links   
    I keep my todo list in Taskpaper (plain text) so I often keep links to emails I want to respond to later. I built this little workflow is based on something i found on Macstories: https://www.macstories.net/stories/generating-markdown-links-to-mail-messages-with-shortcuts-and-applescript/
     
    It is a simple applescript that gets triggered by a keyword or snippet object.

     
    @vitor Is this something that would be useful users of the gallery or does it feel a little niche?
  6. Haha
    zeitlings reacted to sepulchra in New File   
    You are on a tear!
  7. Like
    zeitlings got a reaction from TomBenz in Favorites   
    Hey @TomBenz, fixed in v1.1.0!
     
    And a few more changes:
     
    v1.1.0
    Fixed the displayname of folders containing a dot being cut off Added generic icon for PDF documents Improved fuzzy search Disabled the option to move items if the list is filtered
  8. Like
    zeitlings reacted to TomBenz in Favorites   
    thanks @zeitlings One small observation: If the folder name has "." dot then it takes the name before it only. Pls look into this.
  9. Thanks
    zeitlings got a reaction from sepulchra in AlfredOCR - Optical Character Recognition   
    It's true, the increase in file size can be significant. I did some comparisons with DEVONthink's OCR for your usual text-based PDF documents, which uses Abbyy's engine in the background. In some cases, I was able to get better results in terms of file size with the workflow, so I guess it can hardly be avoided. Abbyy's in-house application can export PDFs by applying MCR compression to the images, which is great and would be awesome to have access to. But that goes way beyond what I had in mind for the workflow 😂.
     
    What I find interesting is that the screenshots most likely don't have any previous text embedded in them, which should allow for a more efficient way to create the new PDF pages, and that the file size still escalates as it does. There is a difference between real-world image dimensions and device-specific metrics. Perhaps what looks like a rather modest screenshot could be a 4K ∞-DPI monstrosity? 
     
    Image compression is its own subgenre, I suppose, and another rabbit hole to get lost in for sure. Maybe I'll look into it sometime in a moment of muse.
     
    You may want to take a look at @xilopaint's Alfred PDF Tools to reduce the pixel density of your document or to scale the images down before attempting the OCR. For really large documents, however, I would recommend to use, and I myself will continue use, the professional tools.
  10. Like
    zeitlings got a reaction from TomBenz in AlfredOCR - Optical Character Recognition   
    It's true, the increase in file size can be significant. I did some comparisons with DEVONthink's OCR for your usual text-based PDF documents, which uses Abbyy's engine in the background. In some cases, I was able to get better results in terms of file size with the workflow, so I guess it can hardly be avoided. Abbyy's in-house application can export PDFs by applying MCR compression to the images, which is great and would be awesome to have access to. But that goes way beyond what I had in mind for the workflow 😂.
     
    What I find interesting is that the screenshots most likely don't have any previous text embedded in them, which should allow for a more efficient way to create the new PDF pages, and that the file size still escalates as it does. There is a difference between real-world image dimensions and device-specific metrics. Perhaps what looks like a rather modest screenshot could be a 4K ∞-DPI monstrosity? 
     
    Image compression is its own subgenre, I suppose, and another rabbit hole to get lost in for sure. Maybe I'll look into it sometime in a moment of muse.
     
    You may want to take a look at @xilopaint's Alfred PDF Tools to reduce the pixel density of your document or to scale the images down before attempting the OCR. For really large documents, however, I would recommend to use, and I myself will continue use, the professional tools.
  11. Like
    zeitlings reacted to xilopaint in AlfredOCR - Optical Character Recognition   
    Thanks for the fix. I'm very impressed with the code simplicity given the quality of the text recognition. We can see Apple has done a great job with the Vision framework.
  12. Like
    zeitlings got a reaction from sepulchra in AlfredOCR - Optical Character Recognition   
    Alfred OCR
    I noticed that Apple's Vision framework finally produces some usable results.
    This means: No external dependencies are required to perform the OCR.
     

     
       Alfred OCR Light
     
    The workflow allows you to copy text from images using optical character recognition.
    Take a snapshot with your mouse or trackpad to automatically copy the recognized text to the clipboard. 

     
       Alfred OCR+
     
    The workflow allows you to copy text from images, or to convert PDF files into searchable PDF documents
    using optical character recognition, and to apply compression to PDF documents.
     
    1 / Snapshot
    Take a snapshot with your mouse or trackpad to automatically copy the recognized text to the clipboard. 
    Default shortcut: ⌘+⇧+6  Default keyword: ocr  
    2 / PDF Document
    To convert a PDF into a searchable PDF document, pass it to the workflow’s Universal Action.  To compress the resulting PDF, pass the source document on while pressing the ⌘+⇧ keys. To open the resulting PDF, pass the source document on while pressing the ⌥+⇧ keys. To force the replacement of a source document, pass it on while pressing the ⌥+⌘ keys. To compress a PDF without performing OCR, pass it to the Compress PDF Document File Action. To view the progress tracker, re-enable the workflow with the Keyword (default: ocr).
     
     
    Configuration
    To open the OCR Workflow Configuration, type the keyword preceeded by a colon (default: ocr).

     
    Languages
    Specify the languages you want the OCR process to consider by adding the appropriate RFC-5646 language tag. The following languages (and regions) are currently supported: en-US, fr-FR, it-IT, de-DE, es-ES, pt-BR, zh-Hans, zh-Hant, yue-Hans, yue-Hant, ko-KR, ja-JA, ru-RU, uk-UA

    Explanations:
    en-US: (English as used in the United States) de-DE: (German as used in Germany) fr-FR: (French as used in France) it-IT: (Italian as used in Italy) es-ES: (Spanish as used in Spain) pt-BR: (Portuguese as used in Brazil) ko-KR: (Korean as used in South Korea) uk-UA: (Ukrainian as used in Ukraine) ja-JA: (Japanese as used in Japan) ru-RU: (Russian as used in Russia) yue-Hant: (Traditional Cantonese) yue-Hans: (Simplified Cantonese) zh-Hant: (Traditional Chinese) zh-Hans: (Simplified Chinese)  
    Change Log
     
    v1.4.0 (OCR+)
    Added bitmap compression and compression facets Added embedding strategy options "Word Granularity" attempts to embed the text word by word "Line Oriented" is the strategy previously used (use if you encounter unexpected results) Improved OCR embedding granularity Fixed 'Recognizer init' error v1.3.0 (OCR+)
    Added PDF compression Added a keyword for quick access to the workflow configuration (Alfred 5.1+) Added Universal Action modifier option to apply compression to PDFs (⇧⌘) Added Universal Action modifier option to open converted PDFs in the default application (⌥⇧) Added a configuration option to open converted PDFs in the default application Added a configuration option to specify how text should be joined when taking a snapshot Added a File Action to compress PDF documents Changed the modifier keys to replace a PDF and added noticeable visual cues (⌥⌘) Changed the way an export strategy is specified by using a pop-up selection box Improved performance v1.2.3 (OCR+)
    Fixed an error thrown due to missing workflow cache directory Fixed snapshot tasks queuing up if they are started before the previous task has finished Added explicit opt-out of Snapshot tasks while PDF conversions are running v1.2.2 (OCR+)
    Fixed low contrast output images produced for some PDF documents Added progress tracker for the document recognition process Added three options to handle document output: export to location, copy to same location and replace. Priority behavior: Replace > Copy > Export. Added new icons Improved output file size for PDF documents that do not already contain text  
    v1.2.0 (OCR Light)
    Add File Action to extract text from images Fix for macOS Sonoma (Compiles the script en passant to compensate for the failure to link objc symbols on macOS 14). v1.1.1 (OCR Light)
    Adds if #available check to accommodate macOS 12.0 v1.1.0 (OCR Light)
    Updated configuration and documentation Added new icon
  13. Like
    zeitlings reacted to vitor in Workflow Cache Dir, how and/or who has to create the Dir   
    [[ -d "${alfred_workflow_data}" ]] || mkdir "${alfred_workflow_data}"
    On my machine that takes (according to time) 1 millisecond after the directory exists (3 to create it). I’m not even sure it takes the full millisecond (can time display lower?). It’s also a single clear line.
     
     
    I do not want a barrage of empty directories. I like to know when a workflow needs those directories or not. Not having a bunch of them also helps when diagnosing workflow problems or migrating them from one Alfred version to the next (like I did with some workflows I used that were abandoned in version 2).

    In addition, there’s no scenario where Alfred could just create the directories once you open the workflows, because there’s always the possibility the user (or something on their machine) would delete them, meaning Alfred itself would need to always do that check. It might save a single line in your code, but it won’t save in execution time. In fact, it would mean that now every workflow that does not need those directories would also be constantly checking for those directories, which is even more wasteful.

    Best we could expect here would be a toggle in the workflow creation sheet to tell if Alfred should create the directories or not, on a workflow-by-workflow basis. Not sure that is even worth it, but it wouldn’t be harmful either (although it might be confusing to some users).
  14. Thanks
    zeitlings got a reaction from dterranova in A Workflow for Transcoding Audio, Video, Images?   
    I've been looking into this a little bit. Without writing the workflow right away myself, I' d still like to give some insights.
     
    tl:dr: use a combination of sips and ffmpeg. 
     
    There are three macOS native utilities that at first sight promise a solution: avconvert, afconvert and sips.
    avconvert seems to work quite well actually. The problem is the limited presets and the absence of decent compression, as far as I can tell. For creating 100MB large, 2min long mp4s, this is nice. What's perhaps interesting about this is that it lets you use apples proprietary HEVC (h.265) and ProRes codecs. For everyday use cases this is irrelevant.  afconvert appears to be extremely limited as in, it can read mp3 but will not write out mp3 files. I stopped looking into it here. Looking at `afconvert --help` seems to suggest that there has been no development since 2013. There is apple's SDK AVFAudio with which you could perhaps write an executable to perform conversions... if you happen to really really want to do that. Without having tested it thoroughly (or at all) sips looks great out of the box! Cf. `sips --formats` for writable image formats.
     
    I also briefly tested VLC's CLI video transcoding and it works pretty well. However, the effort required to fine-tune the parameters could make it difficult to fit into an Alfred workflow. This leaves us with ffmpeg, which has to be installed: `$brew install ffmpeg`. Looks great. I' would start with sips for images and ffmpeg for the rest.
  15. Like
    zeitlings reacted to Andrew in The 'action' property of Script Filter items should also override the 'arg' that is used for the file buffer   
    @zeitlings "action" not overriding "arg" when adding to the buffer was actually an oversight. I'll add this in 5.1.
  16. Like
    zeitlings got a reaction from pseudometa in Duden Workflow   
    Search, navigate and view information from duden.de German spelling dictionary.
     

    shift ⇧ or cmd ⌘+Y: Get QuickLook previews for the landing page, grammar, and synonyms cmd ⌘+L to view the full entry contents. Action synonymes to list all synonyms. Action any synonym to view the entry for it. Action examples or idioms to list all that are available.

     
    https://github.com/zeitlings/alfred-workflows#11-duden-workflow
     

     
    Credits
    SwiftSoup

  17. Like
    zeitlings got a reaction from cands in Define Word - A Better Dictionary   
    Define Word
     
    I wanted a slightly better dictionary for lookups. In particular, I wanted well formatted previews of the entries without having to open the Dictionary app.
    You can choose from all available dictionaries that are installed on your system, define the fallback dictionaries for your lookups, set the font size of the previews, or manually select a dictionary to use. The previews reflect the global appearance, i.e. they have a dark mode! The workflow also includes a preset for looking up synonyms of a word and a convenient keyboard shortcut for quick lookups.

    ‣Download from Github ◂
     
    Usage Note

    Specify the dictionaries you want to use (see Dictionary Options below). Define a fallback dictionary against which possible misspellings will be checked.
    The workflow can be used as a multilingual spell checker.

    Default keyword: def
    Default shortcut:  ⌥+⇧+D 
    Keyword sd: Select a specific dictionary for lookups
    Keyword synd: Find synonyms by consulting the thesauri only (english)
    Cache reset: def ?

    Modifiers
     ⇧  or  ⌘Y  to preview the dictionary entry  ⌃  to see the dictionary associated with the entry  ⌘C  to copy the dictionary entry’s plain text to the clipboard  ⌘⏎  to paste a word to the frontmost application (spell checker)  ⌘L  to view the plain text as large type  
    Preview
            


    Dictionary Options

    Oxford Study Indonesian Dictionary - Inggris-Indonesia • Indonesia-Inggris
    Oxford PWN Polish-English Dictionary / Wielki słownik polsko-angielski
    Oxford Paravia Il Dizionario inglese - italiano/italiano - inglese
    Oxford Portuguese Dictionary - Português-Inglês • Inglês-Português
    Oxford Turkish Dictionary - Türkçe-İngilizce • İngilizce-Türkçe
    Dicionário de Português licenciado para Oxford University Press
    Dizionario italiano da un affiliato di Oxford University Press
    Oxford Russian Dictionary - Русско-Английский • Англо-Русский
    Gran Diccionario Oxford - Español-Inglés • Inglés-Español
    Oxford Arabic Dictionary - عربي-إنجليزي • إنجليزي-عربي
    Oxford Urdu Dictionaries - اردو۔انگریزی • انگریزی-اردو
    Oxford Gujarati Dictionaries - ગુજરાતી-અંગ્રેજી • અંગ્રેજી-ગુજરાતી
    Oxford Tamil Dictionaries - தமிழ்-ஆங்கிலம் • ஆங்கிலம்-தமிழ்
    พจนานุกรมอังกฤษ-ไทย & ไทย-อังกฤษ ฉบับทันสมัยและสมบูรณ์ที่สุด
    Magay Tamás szótár - Magyar-Angol • Angol-Magyar
    Oxford Telugu Dictionaries - తెలుగు-ఇంగ్లీష్ • ఇంగ్లీష్-తెలుగు
    Velký anglicko-český a česko-anglický slovník
    Oxford Bengali Dictionaries - বাংলা-ইংরেজি • ইংরেজি-বাংলা
    Diccionario General de la Lengua Española Vox
    MOT sanakirja suomi-englanti, englanti-suomi
    Oxford Hindi Dictionaries - हिन्दी-अंग्रेज़ी • अंग्रेज़ी-हिन्दी
    מילון אבן-שושן מחודש ומותאם לשנות האלפיים
    Multidictionnaire de la langue française
    PONS Großwörterbuch Französisch Deutsch
    Oxford American Writer’s Thesaurus
    Duden-Wissensnetz deutsche Sprache
    Oxford-Hachette French Dictionary
    Толковый словарь русского языка
    New Oxford American Dictionary
    Prisma Handwoordenboek Engels
    Prisma woordenboek Nederlands
    Oxford Dictionary of English
    พจนานุกรมไทย ฉบับทันสมัยและสมบูรณ์
    Oxford Thesaurus of English
    Politikens Nudansk Ordbog
    Oxford German Dictionary
    超級クラウン中日辞典 / クラウン日中辞典
    Arkadaş Türkçe Sözlük
    뉴에이스 영한사전 / 뉴에이스 한영사전
    ウィズダム英和辞典 / ウィズダム和英辞典
    Apple Dictionary
    Từ điển Lạc Việt
    TTY Dictionary
    Norsk Ordbok
    राजपाल हिन्दी शब्दकोश
    商務新詞典(全新版)
    NE Ordbok
    뉴에이스 국어사전
    譯典通英漢雙向字典
    现代汉语同义词典
    英譯廣東口語詞典
    牛津英汉汉英词典
    漢英對照成語詞典
    现代汉语规范词典
    五南國語活用辭典
    スーパー大辞林
    汉语成语词典
     
     
     
     
  18. Like
    zeitlings got a reaction from sepulchra in AlfredOCR - Optical Character Recognition   
    😱 Try this!
     
    I managed to get some acceptable results. The internal font handling and bounding box scaling works with some heuristics for now, though.
    Also, since there's no progress tracking and the code is completely synchronous, it's best to test the workflow on small documents. Still, the debugger will log some landmarks that you can review after the fact.
     
    @sepulchra You're welcome 🤗 "OCRmyPDF" will most likely give you better results, and should probably remain your go-to if it is already set up. But at least here's a few steps towards a native solution 😁.
  19. Like
    zeitlings got a reaction from sepulchra in AlfredOCR - Optical Character Recognition   
    I guess so. My first experiments, from which the workflow is derived, were actually with PDF documents. I'll play around with that sometime.
  20. Like
    zeitlings got a reaction from xilopaint in AlfredOCR - Optical Character Recognition   
    I guess so. My first experiments, from which the workflow is derived, were actually with PDF documents. I'll play around with that sometime.
  21. Like
    zeitlings got a reaction from xilopaint in AlfredOCR - Optical Character Recognition   
    Alfred OCR
    I noticed that Apple's Vision framework finally produces some usable results.
    This means: No external dependencies are required to perform the OCR.
     

     
       Alfred OCR Light
     
    The workflow allows you to copy text from images using optical character recognition.
    Take a snapshot with your mouse or trackpad to automatically copy the recognized text to the clipboard. 

     
       Alfred OCR+
     
    The workflow allows you to copy text from images, or to convert PDF files into searchable PDF documents
    using optical character recognition, and to apply compression to PDF documents.
     
    1 / Snapshot
    Take a snapshot with your mouse or trackpad to automatically copy the recognized text to the clipboard. 
    Default shortcut: ⌘+⇧+6  Default keyword: ocr  
    2 / PDF Document
    To convert a PDF into a searchable PDF document, pass it to the workflow’s Universal Action.  To compress the resulting PDF, pass the source document on while pressing the ⌘+⇧ keys. To open the resulting PDF, pass the source document on while pressing the ⌥+⇧ keys. To force the replacement of a source document, pass it on while pressing the ⌥+⌘ keys. To compress a PDF without performing OCR, pass it to the Compress PDF Document File Action. To view the progress tracker, re-enable the workflow with the Keyword (default: ocr).
     
     
    Configuration
    To open the OCR Workflow Configuration, type the keyword preceeded by a colon (default: ocr).

     
    Languages
    Specify the languages you want the OCR process to consider by adding the appropriate RFC-5646 language tag. The following languages (and regions) are currently supported: en-US, fr-FR, it-IT, de-DE, es-ES, pt-BR, zh-Hans, zh-Hant, yue-Hans, yue-Hant, ko-KR, ja-JA, ru-RU, uk-UA

    Explanations:
    en-US: (English as used in the United States) de-DE: (German as used in Germany) fr-FR: (French as used in France) it-IT: (Italian as used in Italy) es-ES: (Spanish as used in Spain) pt-BR: (Portuguese as used in Brazil) ko-KR: (Korean as used in South Korea) uk-UA: (Ukrainian as used in Ukraine) ja-JA: (Japanese as used in Japan) ru-RU: (Russian as used in Russia) yue-Hant: (Traditional Cantonese) yue-Hans: (Simplified Cantonese) zh-Hant: (Traditional Chinese) zh-Hans: (Simplified Chinese)  
    Change Log
     
    v1.4.0 (OCR+)
    Added bitmap compression and compression facets Added embedding strategy options "Word Granularity" attempts to embed the text word by word "Line Oriented" is the strategy previously used (use if you encounter unexpected results) Improved OCR embedding granularity Fixed 'Recognizer init' error v1.3.0 (OCR+)
    Added PDF compression Added a keyword for quick access to the workflow configuration (Alfred 5.1+) Added Universal Action modifier option to apply compression to PDFs (⇧⌘) Added Universal Action modifier option to open converted PDFs in the default application (⌥⇧) Added a configuration option to open converted PDFs in the default application Added a configuration option to specify how text should be joined when taking a snapshot Added a File Action to compress PDF documents Changed the modifier keys to replace a PDF and added noticeable visual cues (⌥⌘) Changed the way an export strategy is specified by using a pop-up selection box Improved performance v1.2.3 (OCR+)
    Fixed an error thrown due to missing workflow cache directory Fixed snapshot tasks queuing up if they are started before the previous task has finished Added explicit opt-out of Snapshot tasks while PDF conversions are running v1.2.2 (OCR+)
    Fixed low contrast output images produced for some PDF documents Added progress tracker for the document recognition process Added three options to handle document output: export to location, copy to same location and replace. Priority behavior: Replace > Copy > Export. Added new icons Improved output file size for PDF documents that do not already contain text  
    v1.2.0 (OCR Light)
    Add File Action to extract text from images Fix for macOS Sonoma (Compiles the script en passant to compensate for the failure to link objc symbols on macOS 14). v1.1.1 (OCR Light)
    Adds if #available check to accommodate macOS 12.0 v1.1.0 (OCR Light)
    Updated configuration and documentation Added new icon
  22. Like
    zeitlings got a reaction from Rolis in ChatFred: OpenAI's GPT-model workflow   
    Sounds like your three months trial is over... 
  23. Like
    zeitlings got a reaction from sepulchra in Launch Apps / Finder   
    Choose the Run Script object, pick /usr/bin/osascript (AppleScript) from the Language dropdown and paste this into the Script text field:
     
    tell application "Finder" to activate  
  24. Like
    zeitlings got a reaction from Jasondm007 in AppleScript Dictionaries — Find and open Mac automation dictionaries   
    As a quick fix, you could create the sdef for dt3 in the terminal. Then you just have to move it to a place where the workflow can detect it.
     
    sdef /Applications/DEVONthink\ 3.app > DEVONthink3.sdef  
  25. Like
    zeitlings reacted to suliveevil in Karabiner-Elements Profile Switcher   
    For someone need it.
     
    https://github.com/suliveevil/karabiner-elements-alfred-workflow
     
    ## history
     
    2020-12-24 Sebastian-Hojas [preserve it](https://github.com/Sebastian-Hojas/alfred-workflow-karabiner/tree/karabiner-13.1.0) to works on Karabiner-Elements 13.1.0 and above.
     
    2015-09-14 Genki-S's first [release](https://github.com/Genki-S/alfred-workflow-karabiner)
     
     
     
×
×
  • Create New...