Jump to content

alternative argument types (array/hash)

Recommended Posts

I'd like to request the ability to have different types of arguments.



you could have one type be 'iterator' which iterates through the argument data presented, processing each delimited entitiy as if the invoked action were called with just that string as the argument


you could have another type be 'multi-var' which permits one to pass multiple independent strings to a workflow, which could be referenced as elements of an array, or enumerated strings, or whatever.


this would be backwards compatible, since existing workflows would still be using the string typed handler, which wouldn't need to change, perse


the goal is to allow one to provide structured data to a workflow, be it an array of strings, or a hash of kv pairs, or multiple variables to one script.


I think the existing functionality is good, but with more flexibility, I think the community could do some really cool things that are currently pretty awkward to accomplish, and feel hacky.






Link to comment
Share on other sites

  • 3 weeks later...

It's a nice idea, but how could it be implemented?

The way Alfred runs workflows means the interface is essentially text-only and language agnostic.

To pass native objects, Alfred would have to embed the Python, Ruby, PHP and bash interpreters in the application (like Sublime Text or Vim). You can do that with Python and Ruby, but I don't think PHP/bash are embeddable.

Any more complex types than "text" would have to be passed in a text format, like JSON, YAML or XML.

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