Jump to content

agileadam

Member
  • Posts

    4
  • Joined

  • Last visited

Reputation Activity

  1. Like
    agileadam reacted to juliosecco in Splitting a query into two variables   
    Solved    (well, it seems to...)
     
    here you have the workflow:
     

     
    since a way to set multiple variables seems to be the 'JSON Config' object, I have simply setup a script that outputs a 'JSON config' object, after handling the input and splitting the query as desired...
     
    so my working workflow now has;
     
    1) a keyword object for the input, so you launch it calling on alfred something like prova2 idproj^^projectName;
    2) a script tha handles {query}, splits it with ^^ delimiter and then outputs the JSON to set the variables:
     
    sorry, it is php at the moment, it is the language I find more quick along with javascript, here the code:
     
    <?php $query = $argv[1]; $vars=explode('^^',$query); echo '{   "alfredworkflow" : {     "arg" : "{query}",     "config" : {     },     "variables" : {       "idp": "'.$vars[0].'",       "name": "'.$vars[1].'"     }   } }' ?>   the code simply sets $query to the input, then puts the splitted values on an array $vars then echo ( outputs ) the JSON setting the variables   3) the large type shows the variables, outputting {var:idp}-{var:name}   I'm sure it can be easily rearranged in phyton       obviously it should be refined, for example to correctly escape single quotes on project name, or other things that doesn't come in mind at this hour, but it works...   now the question is: am I doing something that works for casuality, or is it a good and stable approach?   regards,        Giulio
  2. Like
    agileadam reacted to deanishe in Splitting a query into two variables   
    I just posted a thread describing how to get and set variables in code.
     
    I've stickied it for the time being. I guess Vero or Andrew will unsticky it if that's not okay.
  3. Like
    agileadam got a reaction from rice.shawn in Multiple steps (with feedback) in a workflow   
    Hello all,
    I'm looking to write a workflow for a project management system I use. The system has projects. Projects have tasks and milestones. Tasks have subtasks. They have a REST api I've used several times before through both PHP and Python.
     
    I'd like to use the feedback mechanisms to let the user start typing a project, and auto-populate as they type. The thing is, I want them to do more things with that project after they've selected it.

    Here's the flow I'm imagining:
    User starts typing "foo My Pro" and they see some project appear: "My Project 1" and "My Product Launch" User chooses "My Project 1" User hits spacebar User starts typing "Add a " and options appear for "Add a task" and "Add a Milestone". User chooses "Add a task" User hits spacebar User types a task name and hits enter Task submits to the chosen project. Is all of this possible with the new v2 workflows? If you tell me it is possible, I'll move forward to try and make it happen... excitedly.
     
    Thanks!
    -Adam
×
×
  • Create New...