-
Posts
406 -
Joined
-
Last visited
-
Days Won
16
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Everything posted by luckman212
-
Passing '*' as {query} to File Filter... bad?
luckman212 replied to luckman212's topic in Workflow Help & Questions
Man I really went down a rabbit hole on this one. But, thanks for the guidance @deanishe ! I finally got this working the way I want with a Script Filter (as you suggested) and some help from jq. There were some rough spots, because mdfind -onlyin does not accept multiple folders, nor a complex query using kMDItemPath. So I had to string together 2 commands into a variable. It was also "fun" wrestling with jq's syntax to parse the tab separated input, filter out nulls etc. This is most certainly better done in Python but I wasn't sure how to get the Spotlight results and was in a bit of a hurry. So yeah I'm sure there are better ways to do this... In case anyone is curious, here's how I did it: /bin/bash tab=$'\t' query='kMDItemContentTypeTree == "public.image"d && kMDItemContentModificationDate >= $time.today(-3d)' results=$({ mdfind -onlyin ~/Desktop $query; mdfind -onlyin ~/Downloads $query; }) if [ -z "$results" ]; then cat <<-EOJ { "items": [{ "title": "No recent images found", "valid": false, "subtitle": "no recent images found in Desktop or Downloads", "icon": { "path": "error.png" } }]} EOJ exit fi tsv=$(while IFS= read -r FILE; do fname="${FILE##*/}" fullpath="$FILE" dirname="$(dirname "$FILE")" fdate="$(date -r "$FILE" +'%a %-m-%-d-%Y %-l:%M%p')" echo "$fname${tab}$fullpath${tab}$dirname${tab}$fdate" done <<<"$results") /usr/local/bin/jq --slurp --raw-input '{ items: [ split("\n")[] | split("\t") | select(.[0] != null) | { title: .[0], arg: .[1], subtitle: .[2], mods: { shift: { valid: true, arg: .[1], subtitle: .[3] } }, text: { copy: .[1], largetype: .[1] }, icon: { type: "fileicon", path: .[1] } }]}' <<<"$tsv" -
Best way to "Choose File" from inside a workflow?
luckman212 replied to luckman212's topic in Workflow Help & Questions
Thanks @vitor ... Without activate in there, the choose file dialog opens in without focusing itself, so an extra click is required to bring it to the front before it will accept input (at least on my system). I also have a File Action trigger in my workflow, but that forces me to remember not to press [ENTER] when selecting the file and remember to use [CTRL] instead to trigger the File Actions. It's definitely faster when I can remember these sequences -- but...I often don't 😩 ...exactly why I try to avoid using it ! Anyway, for now it seems to be an ok tool for the job. -
I've got a workflow where at some point I want the user to select an image file from the disk. Right now, I'm using Run NSAppleScript (cached) for this. on alfred_script(q) activate set p to "Select an image to process:" set theImage to choose file with prompt p of type {"public.image"} return (POSIX path of theImage) as text end alfred_script Is this "right" ? Is there a faster, better or more efficient way? I ask because it feels "slow" when this step is triggered—much slower than native Alfred objects and File Navigation windows, not to mention that AppleScript seems to be going the way of the dodo. So if there's a way to avoid it or speed it up I'd love to know.
-
Passing '*' as {query} to File Filter... bad?
luckman212 posted a topic in Workflow Help & Questions
I've got a workflow where at some point I want to present a File List showing 10 most recently created images from the last 3 days, from my Desktop and Downloads folders combined. The File Filter object is set like this: This only works if I pass something in via {query}. If {query} is blank, nothing is shown until I either type a * or a [space] or something. So my kludgy workaround is to set {query} to "*" right before before this step. It seems to work fine but feels hacky and wrong. Is there a better way to do this? -
solved [SOLVED] JSON Config - ??? so confused
luckman212 replied to luckman212's topic in Workflow Help & Questions
@deanishe I finally got around to updating this workflow so it queries the sqlite3 db directly. It's a big improvement! Thanks for your help on this. I posted the workflow below ... would love any feedback on things I've done wrong or inefficiently... Type (github) -
@Andrew Thank you heartily for trying to work around this (silly) bug! After updating to 1124, I tested again and found a few rough spots where the clicks weren't registering, even with the workaround. It was basically the bottom 2 pixels of the color boxes (clicking on the 3rd px up from the bottom always worked). I had a nice screencapture video recorded and annotated with details—but then of course my capture program (Capto) crashed and I lost it all. And lo and behold, now I can't reproduce the problem. So it's all for the best. Thank you again! 😃
-
Good idea @vitor — here is the text for copy & pasting: Menu item click area is not aligned correctly / does not respond to clicks properly Since updating to 10.15.1 (19B88) popup menu items in Alfred 4.0 and possibly other applications are not responding to clicks correctly. It seems like the UI element / bounding box that receives the click event is not aligned properly, so that clicks in the lower 50% of the UI element do not trigger the item - only clicks on the UPPER portion of the menu item are working. I posted a bit of detail + some screenshots on the Alfred forum: https://www.alfredforum.com/topic/13957-weird-click-behavior-in-workflow-editor-406-b1123/
-
I filed a bugreport (#FB7432657) under the category "Menu Bar > Incorrect/Unexpected Behavior" - the title is "Menu item click area is not aligned correctly / does not respond to clicks properly" in case anyone else wants to report this. Please use the exact same Title and Category so hopefully this gets noticed.
-
macOS Catalina 10.15.1 (19B88) Alfred 4.0.6 b1123 I've run into a weird problem in the workflow editor. Not sure when it began, but I think around 4.0.4 / 4.0.5 I started noticing it. The problem is, clicking the little colored box UI elements to change an object's color only works on the upper 50% of the pixels in the tiny square. E.g. clicking here does work: but clicking here does nothing (menu does not close even after several clicks). This is strange and I'm 99.9% sure this wasn't an issue before.
-
List Filter - match items that contain Parentheses ( )
luckman212 replied to luckman212's topic in Alfred Feature Suggestions
Wow, this is wonderful news @Andrew ! I'll be at the front of the queue to test this. -
Forum post formatting - how to add inline monospace / code?
luckman212 replied to luckman212's topic in Discussion & Help
Ok thanks. I messed around for a few minutes trying to get that workflow to do something on my system but I think Catalina's maze of new permissions/restrictions are too much for it right now. After finally getting "Notificator.app" to run, I just got stuck in an endless loop of "Reinstalling converter..." -
List Filter - match items that contain Parentheses ( )
luckman212 replied to luckman212's topic in Alfred Feature Suggestions
Ok. Hmm, that's a shame. Most of those threads your link points to are about "fuzzy" or searching... this is similar but not quite the same. I'm not asking for the filter to match "foobar" when typing just "ba". I simply want Alfred to consider a 100% match to words that are bounded by common punctuation marks such as period, dash, parens, brackets etc. Seems like this is a much smaller leap than asking @Andrew to implement true fuzzy searching across the app. -
Specs macOS 10.15 (19A602) Alfred 4.0.5 [1118] I've got a List Filter in a workflow that contains an item named "foobar (baz)". I want to be able to select this item by matching on the word "baz" (in the parentheses). But, when I try this, nothing is found: If I remove the parens from the list item name, it works as expected. Can this be fixed? The same bug also applies to other forms of brackets e.g. curly braces `{ }` and square brackets `[ ]`
-
But then there would need to be 2 separate actions: "execute" vs. "edit". I guess you could have something like hold down command/option to go to the editor, but that seems like it could be even more confusing. How would that lookup work though? You'd have to enter in those additional keywords somewhere in the workflow anyway, no? At that point I don't see what's worse about it.
-
Right but it doesn't execute them, it just opens them in the workflow editor... unless I misunderstand the OP, the request is about setting up multiple keywords/aliases to trigger a workflow (mnemonics)
-
But this is about running workflows, not about finding preferences -?
-
Multiple keywords to trigger the same script filter?
luckman212 replied to luckman212's topic in Alfred Feature Suggestions
Related suggestion: https://www.alfredforum.com/topic/13777-keyword-aliases/ -
Yes, I suggested https://www.alfredforum.com/topic/12717-multiple-keywords-to-trigger-the-same-script-filter/ it a little while ago... Great idea and would be immensely useful to those of us "scatter brains"
-
As someone in my 40s, Large Type is a godsend for me and I use it multiple times daily. I am often displaying long numbers such as 125761245542 and I want them shown "as-is" but Alfred defaults to adding commas: 125,761,245,542 I know about the ⌘Cmd+⌥Opt+L shortcut to display it without them but muscle memory usually makes me forget that and it's a little cumbersome. I'd love to have an option to toggle that so that the ⌘+⌥+L becomes the feature that ADDS the commas, and the default behavior of LargeType was to show "as-is". Thank you so much
-
solved [SOLVED] JSON Config - ??? so confused
luckman212 replied to luckman212's topic in Workflow Help & Questions
Thank you @deanishe (and @Andrew of course) Reading from the db does seem like a good way to go. I'll save this thread for reference, when I have a bit more time to work on it. -
solved [SOLVED] JSON Config - ??? so confused
luckman212 replied to luckman212's topic in Workflow Help & Questions
Ok, well the end goal is a workflow that displays the most recent N clipboard history items and upon selecting one, "types" it to the foreground app by simulating keystrokes (AppleScript `keystroke`). The reason for this to exist is e.g. some websites don't allow copy/paste so you want to "type" something into a field. Or Remote Desktop / ARD / other remote control sessions where a "paste" doesn't always work. This might not be useful for many people but I use it all the time. Here's the workflow as it stands if you want to see: (removed - updated version below...)