Jump to content

a quick and native way to store workflow preferences?


Recommended Posts

That’s not really feasible. Workflow preferences are dependent on how the developer codes them, and you cannot ensure consistency, there. Alfred can’t guess them.
 
The best you could achieve would be to have a standard where you ask developers to follow a certain pattern, and I guarantee that wouldn’t work across the board. I, for one, would certainly not follow it when not appropriate. There’s a weird fetishisation with JSON as the end all to store data, when it isn’t really appropriate in many cases, especially if you’re just storing preferences locally. If I’m making a bash workflow and need a two line preference file, why would I include a JSON parser and make my it more complex, when cat suffices? In some cases, it would even actively lead to a worse experience to the use (e.g. my WatchList workflow where you may edit files by hand).

 

Tangentially, I see no use case for this other than it being (dubiously) nice to have.

Link to comment
Share on other sites

OK,

I in reality was thinking at this thing as a possibility to have a really quick way to store and retrieve some text, without Alfred even knowing what is storing and which format it has.

the format and the content would be obviously dependent of the developer

The JSON was just an example but it could be simply text formatted as you want.

I thinked about JSON because Javascript and PHP can natively parse it.

Edited by juliosecco
Link to comment
Share on other sites

OK,

I in reality was thinking at this thing as a possibility to have a really quick way to store and retrieve some text, without Alfred even knowing what is storing and which format it has.

 

The problem is there's no API for asking Alfred for things. Alfred runs workflows as external processes and reads their STDOUT. It doesn't embed Python/Ruby/JS etc., so there isn't really a way to talk to Alfred. Try a workflow library instead.

 

There’s a weird fetishisation with JSON as the end all to store data, when it isn’t really appropriate in many cases, especially if you’re just storing preferences locally.

 

So very true. JSON was never intended to be anything other than a code-to-code serialisation format. That's why it doesn't even support comments.

 

It's almost certainly not the best choice for a configuration language or for storing data in any given situation (unless you're coding in JavaScript).

Edited by deanishe
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...