Jump to content

Mr Pennyworth

  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Mr Pennyworth

  1. EDIT: the post below is a result of not reading the original post properly where the author clearly mentions they have seen BTT and don't want to use it. Take a look at BetterTouchTool. Here's forum thread discussing the same feature. Looks like exactly the thing you want:
  2. @JakeS Seems like you'll have to resort to this. If you've been programming for a while, it won't be hard at all! (would most likely involve setting breakpoints, adding print statements etc (standard ad-hoc debugging)) I need to learn a thing or two from @deanishe and do at least half as decent a job as he does in extensive, detailed documentation, logging and error reporting! sigh P.S. can you go through the whole log and search for "error", "Error", "ERROR"? Just want to make sure an error isn't buried there somewhere!
  3. Not having the logs sucks You can run the following in the terminal, and then use the workflow. That way, you can see the logs in the terminal in real time. killall AlfredGifBrowser; ./AlfredGifBrowser.app/Contents/MacOS/AlfredGifBrowser
  4. @Cyberskier @JakeS could you try the latest release and see if works on M1 macs? (I don't have access to an M1 mac) Technical details: The workflow no longer depends on nodejs
  5. @Cyberskier apologies! The workflow right now doesn't support M1, and I'm not sure how much of a work it would be to support it. Technical details if curious: The workflow ships with compiled binaries (an entire nodejs runtime and a swift app). As they aren't universal binaries, it won't work on an M1 mac. I'm working on getting rid of nodejs right now. After that, I'll look into making the swift app universal.
  6. @deanishe 🙏🏼 thanks soooo much!! 😇 @Andrew what say for borrowing from deanishe's documentation to update the JSON spec doc?
  7. Following is from the JSON spec for script filter output: I'm having trouble understanding the difference between "filetype" and "fileicon" in my tests so far, it seems like "filetype" always gives a generic blank file icon (even for folders). Take a look at this screenshot. (Download the corresponding workflow) In case you don't feel like downloading the workflow, but just want to take a look at the script filter JSON: file1="icon.png" file2="~/Desktop" file3="./" cat << EOF {"items":[ {"title": "$file1", "subtitle": "no type", "icon": {"path": "$file1"}}, {"title": "$file1", "subtitle": "type: fileicon", "icon": {"type": "fileicon", "path": "$file1"}}, {"title": "$file1", "subtitle": "type: filetype", "icon": {"type": "filetype", "path": "$file1"}}, {"title": "$file2", "subtitle": "no type", "icon": {"path": "$file2"}}, {"title": "$file2", "subtitle": "type: fileicon", "icon": {"type": "fileicon", "path": "$file2"}}, {"title": "$file2", "subtitle": "type: filetype", "icon": {"type": "filetype", "path": "$file2"}}, {"title": "$file3", "subtitle": "no type", "icon": {"path": "$file3"}}, {"title": "$file3", "subtitle": "type: fileicon", "icon": {"type": "fileicon", "path": "$file3"}}, {"title": "$file3", "subtitle": "type: filetype", "icon": {"type": "filetype", "path": "$file3"}}, ]} EOF
  8. @JakeS I'm going to get rid of the javascript and node-bundling altogether. Will post an update here once done in next day or two.
  9. That's not the setup command though. After you download and import the workflow into alfred, you need to open alfred and type .setup-gif-search. Also, can you make sure that you area either using a custom theme for alfred, or, if not, then using a duplicated version of a built-in theme? Do not use any of these: Here's how you can duplicate: Right-click on the theme name:
  10. Yep! I should change that Laziness and reluctance to learn swift. I have very little understanding of swift. Wrote only those things in swift, which felt like very difficult to write in other languages I know (Scala, Javascript, Python). Even the bundled python scripts in the swift app could be written in swift. Every once in while I get the enthusiasm: "lemme get rid of the huge JS dist, and go with a swift program instead" And it dies down quickly: "but it works"
  11. Both act on the "highlighted GIF" When the user presses cmd-enter, the highlighted GIF file gets copied to the clipboard (pasteboard data type public.file-url). In this case, if the user goes to finder, and hits cmd-v, a GIF file will appear in that folder. When the user presses option-enter, the web url of the highlighted GIF gets copied to the clipboard (pasteboard data type public.utf8-plain-text). In this case, if the user goes to any text editor, and hits cmd-v, a link like this will be pasted there: https://c.tenor.com/tVoDE6m_A0QAAAAM/jonah-hill-shriek.gif. You may ask who does the copying and option/cmd distinguishing etc. Again, the swift app. At this point, it feels like "why not spin out a separate app instead of an alfred workflow?" doesn't it? 🙈 Look at the corresponding swift code:
  12. That's where the convoluted-ness of it all comes in. Alfred has only one result (the one seen is json). This same swift app watches for keystrokes and mouse movements and passes them along to the webview. The webview accordingly highlights the corresponding GIF. Similarly, the swift app is responsible for the drag-and-drop functionality. Alfred never really sees all the GIF urls, or any other result list. He only sees one single html file. Here's the same HTML file opened in safari: In this whole thing, alfred acts as a text-input box for the query a platform (the workflow editor) that allows me to stitch multiple hodge-podge scripts to get the final thing working
  13. @deanishe Haha I'm so embarrassed right now! 🙈 I'm doing things in a very convoluted manner For each response the `gifHtml` part is different. For example, you searched for "scream", so it created `scream-gifs.html.html` (meaning to delete that double extension too 🤣) That response is then piped into a python script. The python script creates css that matches alfred's theme and then sends the html from (1) and this css to the swift app The swift app displays injects the css into the html, and displays this injected html in a webview TL;DR: the json is not the same, as the html filename is query-specific What I presently can't seem to figure out is why the swift app never displays the webview for both you and @Miteg !
  14. @Miteg I was wondering whether the problem could be because of BigSur. So I borrowed a BigSur macbook from someone, installed the workflow (0.1.1), and checked. I was not able to reproduce the problem Can you try the following? killall AlfredGifBrowser in terminal killall gif-downloader.bin in terminal Delete the workflow Delete AlfredGifBrowser from Security & Privacy > Accessibility (not just disable, but remove the entry completely) Download and install version 0.1.1 (which fixes issues @deanishe mentioned) Given that the downloader did download the gifs (as I can see from your logs), it feels like the gif browser is not making itself visible. Here's a last resort thing to really make sure the accessibility permissions are accurate: You have already downloaded 0.1.1 above and installed, still the gif browser doesn't show up killall AlfredGifBrowser in terminal Delete AlfredGifBrowser from Security & Privacy > Accessibility (not just disable, but remove the entry completely) Manually add AlfredGifBrowser app to that list again and enable it. Open the workflow folder Drag AlfredGifBrowser from that folder into the accessibility permissions list Enable the checkbox for it
  15. 🙈 Thanks! Fixed! That error doesn't affect the working of the workflow, but definitely not a good idea to pollute the log with red herrings! Thanks again 😇! Fixed!
  16. @Miteg Seems like the gif-downloader.bin keeps crashing. I wonder what is causing the crash. Can you post the contents of /tmp/alfred-gif-search.log?
  17. @Miteg Thanks for the logs! Can you confirm the following? - you are on latest Alfred version (4.3 or above) - you have downloaded the latest workflow (0.1.0) - you are on an intel mac (I haven't tested the workflow on M1 macs) - when you run the following two commands in terminal, you get some number - `pgrep gif-downloader.bin` - `pgrep AlfredGifBrowser` - when you visit http://localhost:8910/?query=haha in your browser, you get some JSON output. Let me know which one of the above fails (if any)
  18. @Miteg That's all right, that's the part of the set up. Every time you run ".setup-gif-search", it is going to ask you to grant the permission. I have a feeling it is already installed correctly. Did you try running it? If it doesn't work, post the debug log here and I can take a look. P.S.: It is not good design that the setup exits without an indication of success. Also, let me see if I can make it such that if someone runs setup multiple times, it doesn't prompt for permissions if already given.
  19. In the meanwhile, if you insist on CSV instead of excel sheets, here's a workflow for you: https://github.com/mr-pennyworth/alfred-lf2csv Example setup: 1) set hotkey to cmd+option+c 2) in the workflow editor, select the list filter you want to export as csv 3) press the hotkey (cmd+option+c), alfred should have a CSV file ready to be dragged-and-dropped
  20. If like me, you don't care about what emacs does with ⌘-v by default, you can add the following to your ~/.emacs ;; Make macOS paste work with ⌘-v (global-set-key (kbd "M-v") 'clipboard-yank)
  21. I have a suspicion that it might not be possible to change that keybinding... Nonetheless, if you're okay with keeping "Fn + Backspace" and want to add your own shortcut in addition, you can follow this: Check my post, and Andrew's explanation following right after that post. Hope it helps!
  22. My emoji search workflow has a JSON file with following stats: Filesize: 2.1 MB Character Count: 1304946 Line Count: 1 Alfred loads it correctly without truncation. Maybe it is worth investigating whether it is Alfred truncating your JSON file or something else causing the truncation...
  23. Ongoing discussion with two working solutions: https://github.com/biati-digital/alfred-calculate-anything/issues/22
  24. Sorry folks for all the errors and failures you keep running into! The workflow is way too hacky with no good logging, error reporting and very poor debugging... I started working on a revamped version with detailed logging, less moving parts and a consolidated code base in a single swift binary, but work at my day job has gotten way too hectic and the revamping of workflows and bugfixes have taken a backseat I'd gladly merge pull requests though! Thanks and apologies!
  • Create New...