Jump to content

Creating nested navigation trees with List Filters


Recommended Posts

In my latest Toolkit Workflow for OpenSea (source code), I've used a set of List Filters to create a nested navigation structure:

 

Untitled.thumb.png.ef37b7c91890eee897b23f0b4dd1ec89.png

 

This means that you can start here:

 

1350744231_2021-12-29(18_59.40)GoogleChrome.thumb.png.ec11d3d864237ff6d5dc12679f40f1c3.png

And then navigate into a submenu and then navigate back up the stack — for example, Settings:

252868655_2021-12-29(19_00.57)GoogleChrome.thumb.png.812f002f4c7d52dd2af8cc5d095e64bc.png

I have a couple questions:

 

  1. Since I want to be able to use my custom icons, I'm using List Filters, but is there another way I could achieve something similar, perhaps w/ a JSON file?
  2. Once I've entered a submenu, typing 'back' doesn't filter the available options as expected. Is that because the title is an environmental variable?
  3. Any other suggestions for how to more efficiently build nest navigation workflows like this?

 

 

 

Link to comment
4 hours ago, Chris Messina said:

perhaps w/ a JSON file?

 

That’s what Script Filters are for. If you want to use a static JSON file, just use cat file.json as the Script.

 

4 hours ago, Chris Messina said:

Is that because the title is an environmental variable?

 

Seems likely. Perhaps a bug?

 

4 hours ago, Chris Messina said:

Any other suggestions for how to more efficiently build nest navigation workflows like this?

 

Instead of having a "Clears value of {query} …" Arg & Vars on every branch out of the Conditional, you could put just one before it to clear arg and set a variable from {query}, then switch on the variable in the Conditional.

 

More generally, moving more of the workflow into scripts. It's significantly easier to manage complexity in code. You could replace the Conditional and its List Filters with a single script. That really pays dividends when you decide you want to change something.

Link to comment
19 hours ago, deanishe said:

That’s what Script Filters are for. If you want to use a static JSON file, just use cat file.json as the Script.

 

Ah ok, thanks! Do you have an example/sample with navigational hierarchy I could work from? Happy to jump in if can start with a sample!

 

Yes, I do think it's a bug. Reported.

 

19 hours ago, deanishe said:

Instead of having a "Clears value of {query} …" Arg & Vars on every branch out of the Conditional, you could put just one before it to clear arg and set a variable from {query}, then switch on the variable in the Conditional.

 

I've updated my Workflow to use this technique. Much simpler — thanks!

 

22 hours ago, deanishe said:

More generally, moving more of the workflow into scripts. It's significantly easier to manage complexity in code. You could replace the Conditional and its List Filters with a single script. That really pays dividends when you decide you want to change something.

 

As I'm sure you know by now, I'm not a programmer/developer... so it tends to be easier for me to "visually program" with Alfred's block builder UI. That said, I'd definitely prefer to just work with a script that I can quickly edit and tweak, especially given all the Toolkits I've made for myself. I'm sure I'm not doing them in an efficient manner, but brute force has been my most effective strategy so far. ¯\_(ツ)_/¯

Link to comment
1 hour ago, Chris Messina said:

Do you have an example/sample with navigational hierarchy I could work from?

 

Not off the top of my head. It's generally best to avoid a deep hierarchy because Alfred doesn't really work that way. It likes flat lists, not trees.

 

My Safari workflow lets you navigate your bookmark hierarchy. The key thing is that it flattens the tree. There's a single Script Filter for bookmarks that can list a single folder's contents and call itself on subfolders.

 

1 hour ago, Chris Messina said:

As I'm sure you know by now, I'm not a programmer/developer... so it tends to be easier for me to "visually program" with Alfred's block builder UI.

 

Sure. Using tools you understand well is inherently easier than using ones you don't. But at some point, the tool you don't understand is so much better suited to a job, turning your nose up at it becomes a bit questionable.

 

I really don't understand your aversion to coding. As far as I can tell, you're all about automation and productivity apps, but you draw the line at the most powerful automation tools of all?

Link to comment
Posted (edited)
On 12/31/2021 at 1:27 AM, deanishe said:

Not off the top of my head. It's generally best to avoid a deep hierarchy because Alfred doesn't really work that way. It likes flat lists, not trees.

 

True!

 

I use my Toolkits to typically remind me of what things are called so I can access deep links without having to navigate by loading various webpages or sifting through different nav conventions. 

 

On 12/31/2021 at 1:27 AM, deanishe said:

I really don't understand your aversion to coding. As far as I can tell, you're all about automation and productivity apps, but you draw the line at the most powerful automation tools of all?

 

I don't have an aversion to coding — and don't draw the line there. I would like to learn but I feel overwhelmed by the choices... Python, Swift, Go, Bash, JavaScript, AppleScript, web APIs, etc... and unfortunately I don't code enough to maintain what I do pick up along the way. I'd love to learn though and agree that I hold myself back by not being a more capable coder. 

 

Where do you suggest I begin, or is that too big a question? (Granted, this may be OT, but I'm still interested given the nature of my original question).

Edited by Chris Messina
added Go
Link to comment
2 hours ago, Chris Messina said:

I feel overwhelmed by the choices...

 

Most languages are pretty similar at the end of the day. bash/zsh and especially AppleScript are weird, but the others are all general-purpose languages and tend to work quite similarly to each other.

 

Python is considered an excellent first language. You can write almost anything in it, and it's extremely popular with non-programmers (scientists, engineers), so there are a lot of docs and tutorials for beginners. Ruby is very similar to Python. Those would be the best two choices, imo. bash/zsh and JavaScript are kinda unavoidable because of their special roles.

 

I'd generally recommend against learning JS first. It's super important to know, but the language and community are both a bit out there. JS also doesn't have a standard library, which is what gives a language most of its capabilities.

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