Jump to content

External triggers for workflows


Recommended Posts

It would be awesome if Alfred could keep an eye on system goings-on and launch workflows based on these events. Example triggers:

  • Wake from sleep
  • Wifi/Bluetooth state change
  • Disk space changes
  • CPU goes over set threshold (e.g. 90% for 10 sec or longer)
  • Battery goes below set percentage
  • Time & date triggers (e.g. 4:00pm, every 2 hours, or on the 3rd Saturday of the current month)

These events are similar to the ones used by Launch Daemons.

 

These kind of triggers would allow Alfred to automatically accomplish tasks based on my criteria; right now I have to call Alfred manually before he can help me.

 

Cheers :)

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

I think this falls under the realm of wanting Alfred to do too much. I don’t dispute the validity/usefulness of the idea, but I think it’d be better suited for another application.

 

Workflows can be very complex, and you can’t simply “launch them”, you need to know what to call for. This is easily circumventable, sure, but in that case, an application that can monitor for those changes can also be used to call Alfred (since it has AppleScript support).

 

Alfred doesn’t even save hotkeys from workflows, to avoid conflicts with other hotkeys set by users, so I really doubt this kind of system monitoring would even be considered. It could also be easily abused (there are a lot of people — likely the majority — even on the forums, that have no idea of how a workflow works internally — they “install” it and expect it to work when they launch it, not for it to always be in the background doing things). As an example, consider my PinAdd workflow (I won’t go into much technical detail of how it works, as it’s explained in the thread). Due to limitations with the way Alfred works, it has a pi script filter that you’ll likely never see — it’s job is to simply get the title and url from your browser’s frontmost tab, so that when you finish typing pin, you can just input your arguments and be on your way. Now imagine that instead of having that setup (which is non-optimal, but it’s really the best way I found so far to go about it, and is an evolution of many different tries), I’d just have it acting up at regular intervals — now you’d have a process eating a (albeit very tiny) portion of your resources, constantly. Now multiply that for the number of workflows you have. Another example would be PinUnread, where hitting up the Pinboard API regularly for your unread bookmarks would make it faster every time you call it, but again, it’d be always eating up resources (including your network connection, in this case), for something you may only use sporadically, or maybe don’t even use anymore.

Of course we can argue that that is also the responsibility of the developer, but workflows are so easy to build that even non-developers do it (that’s the point), sometimes with very little help, and those users may not understand the ramifications of having workflows with such monitoring capabilities (nor do the users who install those).

Alfred presents itself as a launcher, one that you have to take the action (and responsibility) of explicitly calling. Even a workflow like EggTimer, that setups launchd daemon events, works within that rule. Alfred does one thing well (with lots of smaller actions that support and complement the big one), and it should strive not to deviate from, but to be better at it.

Edited by Vítor
Link to comment
Share on other sites

It would be awesome if Alfred could keep an eye on system goings-on and launch workflows based on these events. Example triggers:

  • Wake from sleep
  • Wifi/Bluetooth state change
  • Disk space changes
  • CPU goes over set threshold (e.g. 90% for 10 sec or longer)
  • Battery goes below set percentage
  • Time & date triggers (e.g. 4:00pm, every 2 hours, or on the 3rd Saturday of the current month)

These events are similar to the ones used by Launch Daemons.

 

These kind of triggers would allow Alfred to automatically accomplish tasks based on my criteria; right now I have to call Alfred manually before he can help me.

 

Cheers :)

 

Keyboard Maestro will help with several of these triggers. And you could use Keyboard Maestro to run a script that would perform actions with Alfred. Just a thought.

Link to comment
Share on other sites

  • 7 months later...

time/date triggers are cronjobs, just download cronnix.app for that.

but an event listener (except for time events) would be cool

i am not sure, but i dont think, that the battery percentage is an event, the battery changes every second, its like an interval check (by alfred) and i wouldnt like that.

Link to comment
Share on other sites

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