omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    [Suggestion] Allow ad hoc variables to be appended to editorial:// command URLs

    Editorial
    2
    4
    3223
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • codelahoma
      codelahoma last edited by

      Meaning that any URL parameters that are not reserved by the URL scheme would be available within the triggered workflow as set variables.

      Barring that, perhaps a means to get the URL used to invoke a workflow through something like workflow.get_url()?

      - Rod

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        Interesting idea, though I'm somewhat reluctant to allow arbitrary parameters in editorial:// URLs, since I might add new "reserved" parameters in the future...

        If you're open to scripting, an alternative might be to encode multiple parameters as JSON in the input parameter, and "unpack" them in a script (using the json module). Whether that's a feasible approach also depends on the app that launches the URL of course...

        1 Reply Last reply Reply Quote 0
        • codelahoma
          codelahoma last edited by

          I am open to scripting, and almost mentioned the currently feasible "unpacking" method in my post. :-)

          My gut feeling is that JSON would be tough to do in most calling apps, so I'd have to do my own parsing on the receiving end, but it'd probably be a good enough approach in simple cases.

          How about a reserved URL parameter prefix for user variables?

          Something like editorial://?command=MyWorkflow&usr_myVar=foo, which then does workflow.set_variable('myVar', 'foo') in MyWorkflow's environment before running it.

          That way, I could add as many usr_ prefixed variables as I like, and you'd only have to avoid using that prefix in future keywords.

          1 Reply Last reply Reply Quote 0
          • omz
            omz last edited by

            A prefix might be an option, I could imagine using something like var-xyz=foo to set the variable xyz... I probably won't change the URL scheme in the next update, but I'll keep this in mind.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors