Jump to content

luckman212

Member
  • Posts

    412
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by luckman212

  1. I was super excited to hear about RichText being added to the Snippets function, and one of the first things I did was try it out with Evernote. I have certain styled blocks of text that I want to always re-use in Evernote and I was hoping to use Alfred as a simple template library for these. Alas, it doesn't seem to work right.

     

    Example, here's a section (simple text/codeblock) that I wanted to make into a snippet. In EN it looks like this:

    image.png.a4dbe7d5458b22505838e06752e5f3e2.png

     

    I created a RichText snippet from this and then tried pasting it into a note, here's how it came out:

    (note the codeblock formatting is missing, there is a faint gray background separating each line of text, and the header font has changed from Arial to Times)

    image.png.b9ddc89c4a71a5b35710ac740581c7a6.png

     

    Not sure if this is fixable from Alfred's side or if it's just a peculiarity of how Evernote deals with rich text but... it's no good 😟

    For comparison, the same snippet saved in PasteBot and then pasted into EN works fine and is perfectly formatted.

     

    (Alfred 4.0.1 b1078)

  2. 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... 🙃

     

    image.png.8d9f928b096c7253f167e23e9ab63ab9.png

  3. 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:

    image.png.f128b1695305d030b7e16f344f111a3a.png

     

    image.png.3baebc675ad2e219d33b8aafd61ff59b.png

  4. 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:

    image.png.3379a2303b0af05d223c0d96c5e2a3bc.png

     

    image.png

  5. @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 🙂

  6. 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

    clip-1f9fb8.png.5430bb075497afab1a9c74f6ce5ab6ac.png

    ...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?

  7. @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} ?

  8. 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

     

    1. make a small AppleScript that calls the Alfred workflow with the parameter
    2. 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?

  9. 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...

    image.png.32c7811ed1d2833a638aaee72345425b.png

    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.

  10. 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

  11. 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

    image.png.7a90e9baa91b257333eb7a5468958add.png

     

    vs. this:

    image.png.c2c35d75987e200ce8e879edbfef32e7.png

     

  12. 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

     

×
×
  • Create New...