Jump to content

luckman212

Member
  • Posts

    384
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by luckman212

  1. @Andrew Hmm. Maybe I mis-understand these options then. Here's what I "want" not sure if there's a way to make Alfred behave like this: - Do not run script filter until & unless there's a space after the keyword - When script does run, don't require an argument (but do pass an arg if it's supplied) - If keyword is "sn" and I type "sn " (space after) then script should run passing empty arg (``) or no arg. (Either would be fine!) What currently happens if I set it to "Argument required" is: - Script does not run with just "sn " (makes sense) - I have to type 2 spaces to get the script to run with an empty arg.
  2. Alfred 5.1.1-2138 I have a bunch of Script Filters that have the "with space" checkbox enabled. Not sure when it started, but I noticed that the Script Filters are running even when I don't have the space after the trigger keyword. Screenshot examples below. Am I doing something wrong here or is this a bug?
  3. @vitor Just wanted to thank you again. The {const:alfred_xxx} syntax is working perfectly!
  4. Ah! no, I definitely did not know about const: 🙃 I see that was added to the docs in late 2022... it has probably been a while since I reviewed those. As always, thank you so much for your amazing expertise!
  5. I think I have a need to get the alfred_workflow_uid environment variable into my workflow's {query} so I can pass it to the Terminal Command script object. Can't figure out how to do that. Trying to set it with Args & Vars or JSON Config isn't working. I used "Run Script" with echo $alfred_workflow_uid as a poor man's hack, but I was hoping for a better way. Better yet, can Terminal Command directly access the alfred_workflow_uid somehow?
  6. Thanks for fixing! Looks like it works fine on 5.1.2133 🙂
  7. @Andrew This is great! Exactly what I was hoping for. Thank you! For reference, here's the URL I used (updated to the new scheme Andrew posted below) open 'alfredpreferences://navigateto/features>clipboard>{history}'
  8. One small thing I noticed: If you have multiple trigger keywords defined as "foo||bar", you can search "?bar" using Alfred and he will find the workflow, but typing "bar" in Alfred Preferences search does not find it (only finds "foo" or "foo||bar"). This is as of 5.1.2130.
  9. Wow - most underrated feature announcement ever-- This is great! Do you know if the keyword1||keyword2 would work in variable substitution mode? i.e. set myVar = "apple||banana" and then set keyword trigger to {var:myVar} ?
  10. @Casper + @vitor I posted some possibly interesting findings about this over on that github issue #4.
  11. It's ok. These are just nitpicks. There are 1001 ways to achieve the same goal in programming. That's part of the fun. In any case, the days of humans having to think about these things are numbered. With ChatGPT cranking out better code than I could ever hope to write, it appears my future is working in a coal mine, not in a comfortable chair critiquing Alfred workflows 😐
  12. @sepulchra Nice. One more small comment: in your example script, you define a query variable, but your script never uses it.
  13. Maybe I'm late to this party but, just in case: @sepulchra you don't need regex to extract a single piece of metadata as a plain string. You can use e.g. mdls -raw -name kMDItemFSCreatorCode /path/to/file
  14. For some reason I thought I could use a dynamic placeholder like {clipboard:0} in the Subtitle field of a List Filter. But, it doesn't work. Am I imagining that this ever worked? I know I could use a Script Filter, but this is for a very simple use case and I'd rather not have to write a whole script just to display this one bit of info.
  15. Hi @vitor ! The use case is I have a script that does some processing on recent files that are in the clipboard history. For the script filter to work, that feature needs to be enabled. I was able to figure out how to programmatically check for that, but to close the loop I'd like the "action" item from that script filter to directly open Alfred Prefs to the page so the user can enable the checkbox. Indeed, ?clipboard does take me to the correct place! But I was hoping the script could open this for the user automatically. I assume there's probably an undocumented URL scheme available, since I guess that might be how Alfred gets the separate Alfred Preferences.app to open directly to that specific page.
  16. Until there's a better way, I came up with this poor man's solution... 🤷 #!/usr/bin/env bash # quits Alfred Prefs (if open) and then opens it to the Features -> Clipboard tab bid='com.runningwithcrayons.Alfred-Preferences' osascript <<EOS &>/dev/null with timeout of 5 seconds tell application id "$bid" to quit end timeout EOS defaults write $bid lastFeature clipboard defaults write $bid lastTab features open -b $bid
  17. Is there any way to programmatically open Alfred's preferences app to specific areas? For example directly to the "Features → Clipboard History" section? Via URL Scheme perhaps?
  18. Nevermind—found it! Apparently he exports the following environment variable: alfred_preferences_localhash Still a mystery how it's generated, but it's one that won't necessarily keep me awake at night.
  19. I have a Python script contained in my Workflow that needs to know the state of the enabledFiles setting which is a Local preference, apparently stored at: <path-to-synced-prefs>/Alfred.alfredpreferences/preferences/local/<sha1-hash-of-???>/features/clipboard/prefs.plist I can't figure out how to reverse the hash/ID (sha1?) that identifies the local machine. I assume it's some combination of Machine SN#, name, type, etc. but I can't find documentation on that anywhere. Hoping someone can help...🙂
  20. @oorbx Nice idea. I already have another workflow that uses imagemagick to perform some operations like that, DPI conversions, resizing, adding borders. I'll eventually try to integrate them all together in a future version, but it wouldn't be ready for a little while.
  21. Somehow the wrong change got committed at some point while I was removing the Bash5'isms. I'll upload a v2.3.1 soon that fixes it...
  22. @oorbx Actually it seems some incorrect code slipped thru. Not sure what happened but I'm away from my Mac at the moment. I'll fix it asap, sorry
  23. No, I don't think it's the 13.3 beta. looking at the pastebin it seems you still have an old version of the workflow installed. Not sure why the in place upgrade didn't work, but why don't you go ahead and delete the entire workflow, download the latest one and reinstall it Let me know if that clears things up. @oorbx
  24. @oorbx Hmm. Can you please open your debug console, press "Clear" and then run the workflow all the way through, then copy & paste all the output to a pastebin?
×
×
  • Create New...