Jump to content

Recommended Posts

Hey everyone. I released a rather big update to the workflow. It has many more filters.

 

You can jump to any stack exchange website super quickly, it has more subreddits, courses and books and many more. It heavily leverages the curated lists by Learn Anything found here so if you wish to contribute to them, that would be amazing.

 

Here  you can find the download of it. I hope you like it. Also most useful lists have an external trigger too or you can add a hotkey trigger too if you wish.

 

The auto update is still broken as I still have to rewrite it to not use the dependencies. But this update is quite awesome imo.

 

Big thanks to @deanishe once again as that trick with using cat on pure JSON is really really awesome. ?

Edited by nikivi

Share this post


Link to post

I also think it goes quite well with ask, create, share workflow I shared earlier. Will try my hand at web searches though. If I make it, my life would be complete.  The cool thing with that one, aside from of course allowing me to fuzzy search through all the options. I can not only have static searches but link to other workflows too that leverage autosuggestions like Searchio. 

Edited by nikivi

Share this post


Link to post

Released a small update to the workflow. Can get it from GitHub or wait a few days to get notified of it if you already installed it.

 

There is a new object with reddit multis I use and a lot of modifiers attached to most objects where appropriate. 

 

I really dislike how Alfred can't handle such a large number of objects and is acting quite slow because of it but there is not much I can do. I can't split it up into two workflows as I really want to keep everything in one place.

 

Perhaps @Andrew will improve Alfred performance in the future. 

Edited by nikivi

Share this post


Link to post
15 hours ago, nikivi said:

but there is not much I can do.

 

You could structure the workflow properly instead. You've already been shown how to do this. Twice.

 

Share this post


Link to post
1 hour ago, deanishe said:

You could structure the workflow properly instead. You've already been shown how to do this. Twice.

 

Yeah I know, but that structure does not work in my case. I need many external triggers, each attached to read a single JSON object. And I have a hotkey set for each one. 

 

Your solution was for a different thing and a different problem. I don't really see how that fits with what I want to achieve (an external trigger for reading a single JSON object) with modifiers attached where necessary. I also aready use your solution for passing the actual files to read as argument in the big list filter but I have no idea how to mitigate the mass number of single purpose script filters.

 

I can probably write out the entire thing in code and have one powerful script filter that can cover all these cases and I can just have different external triggers passing in various arguments. I might do that in the future but for now this works kind of.

Edited by nikivi

Share this post


Link to post

Actually now I see what you mean, I can do this : 

 

Sst0p1F.png 

 

And have blogs external pass in the path. That's actually really smart.

 

I can't use the same trick for the externals where I use modifiers though, those will still need to be isolated. Or I am again stupid and don't see something obvious. 

 

In any way, thanks @deanishe, that does simplify things a bit.

Edited by nikivi

Share this post


Link to post

I uploaded the updated workflow to GitHub

 

Don't really know how I can apply the same trick to objects that have custom modifiers in them. But it does look a lot nicer and cleaner now.

Edited by nikivi

Share this post


Link to post

Actually I thought of a way I can simplify it even further, with filters. 

 

Here is what I came up with.

 

My idea was that I filter by the paths passed in. So if a certain path passed in, needs my custom modifiers, I filter it.

 

However I don't know how I can make the above filter so that it will run when none of the below filters matched. This one :

 

EBb67fY.png 

 

The only way I see how to do it is by putting in the regex there but that regex will be really ugly (it will need to exclude all the paths below).

 

Maybe there is a better way to do this. 

Edited by nikivi

Share this post


Link to post

Your external triggers are all basically identical. Every single one passes {query} through to the Script Filter. You can delete all of them but one. Similarly, you have loads of completely identical Open URL actions. Use a junction and remove all but one of the Open URLs.

 

14 minutes ago, nikivi said:

This one :

 

I have no idea what you're trying to achieve. Both branches point to Open URL actions. What's the difference?

 

Regarding the generally excessive number of mostly-identical Script Filters you have, why don't you include the other stuff you need (e.g. the URL suffixes for Reddit queries) as workflow variables in the JSON?

 

Share this post


Link to post
22 minutes ago, deanishe said:

You can delete all of them but one.

 

Oh wow, you are right. Didn't think of it like that.

22 minutes ago, deanishe said:

I have no idea what you're trying to achieve. Both branches point to Open URL actions. What's the difference?

 

What I am trying to do is bring these script filters : 

 

O1waigA.png 

 

That have various modifiers that modify the url and have that work from the external trigger here : 

 

4gN4od8.png 

 

So I will call this external trigger 'open' with the path passed in like I do here from Karabiner. Then it will go to the script filter, script filter will read that path and show results. 

 

But what I wish now though is so that my modifiers work in this scenario too. So for example if the path passed in is 'lists/books.json', then I can only press return to open the url and that's it.

 

But if the path passed in is 'lists/reddit.json', I can also press return but I can also use my specified modifiers I set up for this path. I don't really know how I can make this work and if I can.

 

22 minutes ago, deanishe said:

why don't you include the other stuff you need (e.g. the URL suffixes for Reddit queries) as workflow variables in the JSON?

I don't get what you mean by that. Currently the JSON's that are being placed in the lists folder are downloaded from MyMindNode. Here is JSON of the books mind map for example and here is how the mind map looks actually.

 

I then have a script that will CURL those JSON's and then parse them into appropriate Alfred JSON. Currently that process requires dependencies thus users like you can't run that update script. In future I hope to rewrite that so that all this JSON gets updated periodically without any user interaction.

 

Not fully sure what you mean though with workflow variables and how that will apply with my URL prefixes and modifiers.

 

Here is the updated workflow, given the advice you gave.

 

All I wish is to move those script filters with custom modifiers options and have that somehow work from main outgoing script filter on the top. This way even if you are coming from the inside list filter here : 

 

xY8P9QE.png

 

You will still be able to use custom modifiers for paths that have these modifiers set up. That would be amazing.

Share this post


Link to post
17 minutes ago, nikivi said:

Not fully sure what you mean though with workflow variables and how that will apply with my URL prefixes and modifiers.

 

You can pass, say, a URL template, or a suffix as a workflow variable, so you don't need a separate Open URL action for each URL suffix.

 

19 minutes ago, nikivi said:

But if the path passed in is 'lists/reddit.json', I can also press return but I can also use my specified modifiers I set up for this path. I don't really know how I can make this work and if I can.

 

You can also set modifiers via JSON. 

Share this post


Link to post

Okay I solved it. ?

 

Can grab latest release from GitHub.

 

I hope that's what you meant by better layout. I think this works quite nicely.

 

I also added subtext to each modifier so you can press modifier to see it. I do wish though that @Andrew added this.

Edited by nikivi

Share this post


Link to post

Okay, never mind, it doesn't work fully.

 

Occasionally picking an option from the 'inside' list filter, will not show anything and will dismiss Alfred. On other occasions it works well.

 

My only guess is that Alfred can't handle that many filters at once and breaks down. ?  

Edited by nikivi

Share this post


Link to post

Oddly enough, if I call the script filters not from that List Filter but from the external trigger and pass in the path as argument, it works 100 % of the times.

 

If I can get this workflow to work correctly, it would be so so awesome.

Edited by nikivi

Share this post


Link to post

Yesss

 

It works now. Setting a small 0.01 second timeout fixed it. I guess Alfred List Filter is too fast or something.

 

94f.png 

 

Can grab the final workflow on GitHub.

 

Thank you a lot @deanishe. If you think there is still something I can improve with the layout of it, I would love to hear it.

Share this post


Link to post

@nikivi You need to set the connection coming out of the list filter (the little circle on the connection) to "Don't close Alfred window on actioning result". This will change it to a square, and should prevent the window closing between the list filter and script filter.

Share this post


Link to post

Released small update to the workflow.


Can find it on GitHub. Transferred all of my notes, now everything can be queried from Alfred. Extending my idea of bootstrapping knowledge. Also added book notes I made and explain shell filter that filters through various shell commands and gives you their documentation super fast.


It's pretty insane already. And overall lays a pretty good foundation going forward.


The most awesome part comes soon though once Learn Anything releases its official JSON endpoints. The Alfred workflow for that would be so so cool. You will be able to literally query any learnable topic on Earth and get the most efficient resources for learning it. It will be even faster than Google since for Google you have to first make the search, wait for page to load, then pick result. Here you just query topic, query result, use the result, all from Alfred. Pretty awesome. 

 

Oh and the ultimate goal with Learn Anything is to have people learning topics they never even thought of encountering in the most efficient way. Imagine 7 billion people in the world knowing how to program computers, writing alfred workflows, automation scripts, websites. What a world that would be.

Edited by nikivi

Share this post


Link to post

Hey @deanishe, sorry for pinging you like that. 

 

I tried to resolve the issue myself but I am not really sure how to approach it as I believe things should work.

 

I am in the process of rewriting this workflow in Go to add some really sweet new features. The code (just boilerplate awgo setup + previous workflow moved under 'workflow' so everything works) can be seen here.

 

Here is the modified workflow modified and built with the code above.

 

My question is why aren't magic arguments working : 

tKAg7gP.png 

 

The are working in my other Go workflows and the code I basically transferred from there to start a new workflow so not really sure. It's probably again some stupid mistake I did but I don't really know what. Oh and I did look in the debugger. Didn't really see anything there related to this.

 

Thank you a lot if you do decide to take a look at this.

Edited by nikivi

Share this post


Link to post
43 minutes ago, nikivi said:

My question is why aren't magic arguments working

 

Because wf.Args() isn’t being called or you’re not actually passing the query to the workflow.

 

Share this post


Link to post

Released new update to update the index for the wiki. The wiki is pretty big now and I use it myself many many times a day. I hope someone else might find it useful too. Let me know if you do. ?  

 

This should be the last update with manual index update, next update should install the SUMMARY.md index from GitHub and cache it for a week or so. I am still battling with how to make it work on the Go side but I'll manage it soon.

 

Also I cannot wait to split the mess that this workflow is and separate the curated lists stuff and put it in Alfred Learn Anything. Everything cached and automatically updated right from GitHub. Would be crazy cool.

 

Hope you like the update. ?

 

Edited by nikivi

Share this post


Link to post

Made a small update to the workflow to search through all the links in the wiki. As well as improved the general search so it gets correct URLs. Small demo below.

 

Edited by nikivi

Share this post


Link to post

The link search isn’t working yet as it’s hard coded to my file system. Have to read up on awgo caching and things. 🐝

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...