Jump to content

Is there any way for a workflow to know how many items Alfred shows?


Recommended Posts

Sometimes its not clear that there are more items available 'below Alfred's fold'.

For example, in this list it's not clear that there are actually more options to choose from:

image.thumb.png.61b164ad4772ddfa1cdb341c540b5c83.png

image.thumb.png.27b0bcccdde5ee161ad6614f231b2c05.png

 

So I thought I could get clever in a script filter and insert some helper text when there's too many entries

 

# Overflow check
if len(input_json["items"]) > 9:
    # Add "subtitle" to the last visible entry
    input_json["items"][8]["subtitle"] = "Scroll for more swatches…"

 

image.thumb.png.0c06e0a5c3caea25aab2ba8e16ddafc1.png

 

But this will only work as long as the user has chosen to show 9 items

image.thumb.png.f464300840a4e269281d7483361a32a4.png

 

So I'm wondering if there's any way to access this "I want to see" value? I have a feeling it's not possible, because if it were, it would be among the Workflow Script Environment Variables. But maybe there's another way to determine the total entries Alfred is showing?

 

Edited by Floating.Point
fixed some wording
Link to comment

It’s possible but it would be a hacky solution and you’d be fighting against user preference. Just like users can choose to show, hide, or conditionally show subtext, they can also choose to show, hide, or conditionally show the scroll bar, which is an indicator of more results. With your current settings, having the scroll bar show Automatically, you may indeed not know there are more results before going down, but if you change it to Always, you do know.

Link to comment

Ah yeah I don’t want to do anything hacky. I think I have always just incorrectly assumed ‘always’ mode would show a scroll bar even when there was nothing to scroll. Don’t I feel foolish now, learning this is not the case. Changing from ‘automatic’ mode to ‘always’ mode is all I needed to do. I assume this is Alfred’s default too and I must have just changed it years ago and never thought twice about it. Thanks for humouring me and as always being so gracious and helpful 😊

Link to comment
16 minutes ago, Floating.Point said:

Thanks for humouring me and as always being so gracious and helpful


Thank you for being understanding and explaining your use cases thoroughly. It’s especially rewarding to help those who help themselves and have a clear desire to do things well.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...