Jump to content

luckman212

Member
  • Posts

    385
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by luckman212

  1. I saw Alfred4 is out today (first release!) but I didn't see anything like this in the release notes. Maybe 4.1 4.2 4.3 4.4 😉
  2. Got it. I really have to level up my Python skills so I can generate proper JSON. Right now my script filters are all limited to Bash/XML which does not support the match property.
  3. Answering my own question. I found the solution here (Thanks @Vero !! ) http://www.packal.org/workflow/contacts-filter-text-content Basically, un-check "Contacts in Default Results and then create a custom workflow to search contacts. I used just the single letter "c" for mine. Works perfectly!! I think this could use a little mention or a bit of documentation on https://www.alfredapp.com/help/features/contacts/. Could be a slow brain day for me but I struggled to figure this out and it should be more obvious I think... 🙃
  4. I have a few keyword triggers that also seem to show results from Contacts. I don't want this. If a keyword matches, I want ONLY the results from that keyword/script filter. Is this possible? I know I can turn off the checkbox in Default results: But then, how do I search Contacts and take action on them??
  5. I have a lot of list & script filters. They are my favorite feature of Alfred and are probably the most powerful thing about it. One wish I have is that I would like to have an option (per script filter object) to have the search results/filter match on both the Title or the SUBTITLE. Example, in the filter below, if I was to type "entire", I would like the "Clear" item to be matched:
  6. I saw this has been asked a few times before (e.g. here) but there wasn't a clear answer. Since Alfred 4 is coming soon, I would like to throw this into the pot to see if it might be possible. My brain is getting old. It's hard to remember all the different keywords and hotkeys I've set up. To aid myself I like to be able to use multiple keywords to trigger the same workflow step. Example, I have a workflow for connecting Bluetooth devices, that I trigger using `bt` instead of just "bt" I'd like to add a few more keywords, e.g. "blue", "connect", "audio" etc. I know I can duplicate the script filter opject and connect its Output to the same step—it's a poor man's workaround, but it'd be cleaner and better to allow multiple keywords, such as this:
  7. @deanishe Hmm, interesting! I knew XML was considered "legacy" but didn't know it was deprecated completely. I want to switch to JSON but my Python is super rusty and I was struggling to generate clean, valid JSON with pure Bash scripting. Any tips for generating JSON from e.g. CSV or tabular data? For now, I came up with a poor man's workaround- using semicolon `;` as a delimiter instead. I'm not happy about it, but I guess this will probably not be fixed in Alfred so I will try to look at switching to JSON. I see that XML mode also supports using variables in the script filter so I may give that a try as well. Thanks for the help 🙂
  8. Thanks @deanishe for taking time to reply. Here's a sample workflow that shows the issue I'm facing called BrokenTabs https://nas.ldh.me/ss/BrokenTabs.alfredworkflow.zip It has 2 keyword triggers: btabsf (script filter) and btablf (list filter) The List Filter works fine, but the script filter doesn't. Hope you will be able to see what I mean after playing with it.
  9. Pulling my hair out on this one. I have a script filter which generates args in the format arg1(tab)arg2(tab)arg3 with spaces Where (tab) is a literal tab character (HEX 0x09) aka \t in regex. No matter what I've tried, Alfred always mangles the tabs into spaces (HEX 0x20) which is no good for me since Arg3 may contain spaces and needs to be processed by the bash script as a single parameter. If, instead of a Script Filter, I use a standard List Filter and press the [tab] key in the Arg field, something like this ...that passes the Tabs on to the bash script correctly. Anyone know why this is happening or is there any workaround? Is this a bug?
  10. Thank you @GuiB that is definitely helpful. I will try fooling around with this probably this weekend when I have more time (hopefully)
  11. @GuiB Thank you for posting this! It's a very interesting solution. I'm not sure I'm up to the challenge of rewriting my bash script in JavaScript so I'll have to see about that. Also, I need the output of the program to be passed along as a parameter to the next step in the Alfred workflow. Not sure how to do that since the "meat" of the task is now running in a subprocess. I guess maybe in the JXA script it should output results to a /tmp file and then when control returns to Alfred, it can read that file back in and push it back into the {query} ?
  12. @deanishe Simply brilliant! I had to muck around a bit but you got me started in the right direction and I eventually nailed it. Thank you so much Is anyone interested in the solution? I can post it if yes.
  13. hey Alfred gurus! I've got a workflow that I use frequently to initiate calls via my Polycom desk phone. It's super handy but I'd like to go a step further and be able to use it for clickable tel:// links found on webpages etc. I think what I need is to register a "protocol handler" for this. I assume it would be something like make a small AppleScript that calls the Alfred workflow with the parameter register that App as the protocol handler for tel:// URIs I think I can probably handle step 1 but I'm not sure how to handle part 2. Anyone done anything like this?
  14. Thanks - would that be possible if no Alfred window is showing? Because primarily this workflow is triggered via hotkey only. Got any links or examples where I can read up more about the `rerun` thing?
  15. Thank you, I believe this would be very useful, for creating singletons/mutex's/lockfiles etc. as well as a bunch of other things.
  16. For an example of what I'm talking about, try pasting this script into Script Editor and running it set n to 5 set progress total steps to n set progress description to "Script Progress" set progress additional description to "This should be helpful" repeat with i from 1 to n delay 1 set progress completed steps to i end repeat If you save that as an Application and run it, you get a very nice popup progress bar... But, running this code from within Alfred does nothing. Also, I've tried using cocoaDialog (both 2.1.1 and the 3.0b7) and can't get either of them to run from within a workflow, I think possibly due to SIP/code signing issuues.
  17. Hey workflow gurus! I have implemented a workflow to perform various file hashing functions (md5, sha1, sha256) on selected files, and display results in a LargeType window, or optionally send to a CSV and open in Numbers.app. It also supports triggering via both a Hotkey as well as a Keyword, and supports queueing up files and then processing the queue later. It's pretty nifty and I'm almost done polishing it and I plan to make it publicly available. One thing I'm having a hard time with is- on large files (e.g. 1GB+) the hashing takes a bit of time as Alfred churns through a Bash script, and there's no feedback to the user that anything's happening. I'd like to show some type of progress bar or progress display in the menu bar etc. I have been banging my head on this for a while now but I can't figure out a good solution. I know AppleScript supports the concept of Progress (see Mac Automation Scripting Guide - Displaying Progress) but when I tried this from inside Alfred, it just didn't work properly and always stayed at 0%, even though the exact same script when run from Script Editor worked fine. I've found a couple of "helper apps" that I am considering but none are very actively maintained and I was really hoping for a "native" solution that didn't involve adding more 3rd party tools and dealing with licenses etc. links: https://cocoadialog.com/ -- related https://github.com/cocoadialog/cocoadialog/issues/108 https://github.com/tsntsumi/ProgressDialog https://www.bluem.net/en/projects/pashua/ - GitHub page: https://github.com/BlueM/Pashua Anyone got any ideas for this? thank you
  18. Thanks @vitor It isn't working for me outside of script actions. For example, try this simple workflow: Hotkey settings Large Type settings The output for me is:
  19. These script environment variables (e.g. `alfred_workflow_uid`) have been very useful to me. https://www.alfredapp.com/help/workflows/script-environment-variables/ I'd like to be able to use them outside of bash or python script actions. Any reason they're not made available throughout the entire workflow?
  20. Simple question but I searched a bit and couldn't find any discussion of it. Has there been any consideration given to adding top/bottom (vertical) "connection points" for the workflow objects? It would make the graphs a lot neater looking when there are lots of paths being followed. The left/top points would be for "input" and the right/bottom points for "output". example, this vs. this:
  21. Well, that was a long & winding road. I'm new to Alfred so I'm still figuring things out. I tried everything I could to avoid using a /tmp file but this was the only way that worked. Everything else—using variables, trying to process the clipboard buffers from within the workflow itself, using external triggers etc, all failed. This seems to be due to the way Alfred processes the query buffer as it passes through the workflow. Internally, a reference like `{clipboard:11}` will always return that exact text (e.g. if used in a comparison statement from bash or python) -- it only converts it to the actual clipboard value during OUTPUT actions such as Large Type or Write Text File. The 2nd problem is, if `{clipboard:11}` contains a NULL (empty) value, instead of returning BLANK (which would be expected), Alfred insists on instead outputting the dynamic placeholder itself. So, if you have only 5 clips and you ask for 10 to be merged, the last 5 will be written out as just `{clipboard:6}, {clipboard:7}...` etc. TL;DR I could not find a reliable way to test for "empty" values and omit them from the output other than using Write Text File and then processing it with sed. This works fine though, and the script cleans up the /tmp file after itself and is pretty quick about it. If anyone knows a better way I'm all ears. But I think this is something that would have to be fixed in Alfred itself. Here's the new version: changes omits empty strings from output if you request > clips than exist in the history configurable MIN_CLIPS and MAX_CLIPS variables added notifications for success/failure https://github.com/luckman212/clipmerge-alfred-workflow/blob/master/README.md
  22. Thanks. Yes, I noticed the same thing after posting. I'm working on a fix for if you type a number that exceeds the number of clips you have in the history.
  23. Figured out a way - not sure if it's the "right" way but, it works well enough. I used a couple of bash scripts to validate/filter the input as well as loop & process the output. If you want to have a look... (link removed, scroll down for the new version)
  24. I'm trying to make a workflow that accepts a single parameter "N" (a number) and then uses that to merge the last N clipboards, and paste that to the frontmost app. Let's call it "clipmerge" and it uses keyword `cm`. e.g. "cm9" would take {clipboard:0} {clipboard:1} ... {clipboard:8} and merge them. Anyone got any ideas on how to achieve this? edit: I figured out my own solution... click here
×
×
  • Create New...