• NikkiSchwartzVB

    @ccc is this complicated to do? (Get the script behind the custom ui in editorial, as it says in documentation that I can theoretically do with workflow.get_view)

    posted in Editorial read more
  • NikkiSchwartzVB

    "Behind the scenes, the controls of a Custom UI action correspond to Python objects from the ui module, so you can mix and match Python code with workflow-based UIs. When you have a custom UI and you want to get at the underlying view objects, you can do this with the workflow.get_view() method. This returns the root view of the currently-running Custom UI action, and you can use this to traverse the view hierarchy and make changes that wouldn’t be possible with workflow actions alone."

    Got that... how do I get to the underlying script to play around with it?

    import editor
    import console
    import os
    import workflow
    import ui
    
    view = workflow.get_view()```
    
    
    #I tried print but I couldn't get that to give me anything but numbers... obviously not editable.

    posted in Editorial read more
  • NikkiSchwartzVB

    @dgelessus @ccc

    I finally made it work. You both will understand better than I. (Have I mentioned I have literally nearly zero experience coding... outside of things like Editorial and the Workflow app and copy and pasting some HTML stuff).

    That said. Someone throw a party!

    #coding: utf-8
    import datetime
    import workflow
    
    ymd = workflow.get_variable('DOB')
    year, month, day = ymd.split(',')
    delta_t = datetime.date.today() - datetime.date(int(year.strip()), int(month.strip()), int(day.strip()))
    age = int(delta_t.days / 365.2425)
    workflow.set_variable('age of client', str(age))
    workflow.set_output(str(age))
    

    posted in Editorial read more
  • NikkiSchwartzVB

    I feel like I am learning Greek, but only to say... How old am I? To a computer, that doesn't natively speak Greek (I think my analogy breaks down somewhere, 😂). Maybe I mean learning Greek by talking to a computer that speaks Japanese and then tries to translate it back into Greek, which I don't really speak. (I give up on coming up with a proper analogy for right now)

    I think I'm just putting things in the wrong places... I keep looking back at the two examples that you wrote that obviously work... To see if I can emulate that and find out where I'm going wrong, but not having much luck. (I did read through the link on string split syntax... But again, Greek?)

    #coding: utf-8
    import datetime
    import workflow
    
    action_in = workflow.get_variable('DOB')
    
    year, month, day = action_in.split(',')
    
    delta_t = datetime.date.today() - datetime.date(int(year.strip()), int(month.strip()), int(day.strip()))
    
    workflow.set_variable('age') = int(delta_t.days / 365.2425)
    
    action_out = workflow.set_output('age')
    

    posted in Editorial read more
  • NikkiSchwartzVB

    @ccc

    Here's what I tried. No Bueno.

    #coding: utf-8
    import datetime
    import workflow
    
    action_in = workflow.get_variable('DOB')
    
    year, month, day = action_in.split(',')
    
    delta_t = datetime.date.today() - datetime.date(year, month, day)
    
    workflow.set_variable('age') = int(delta_t.days / 365.2425)
    
    action_out = workflow.set_output('age')```

    posted in Editorial read more
  • NikkiSchwartzVB

    I'm essentially trying to combine two short scripts that @ccc wrote.

    http://www.editorial-workflows.com/workflow/5821858704261120/n5P57YobUeM

    And

    http://www.editorial-workflows.com/workflow/5880523125686272/mqcIZrzeGlE

    Here's what I'm trying to do...

    As I'm filling out the difference to variables for this report, I want it to self-populate and automate as much as possible. I do these for every client.

    I want to put in the client's Birthdate while running a workflow... Then have python calculate age in the background and spit that back out as a variable.

    I'm just not making sense of all the pieces that need to go into the python script, itself. I understand the math behind getting the age, just not how to put it all in and bake a cake with it.

    posted in Editorial read more
  • NikkiSchwartzVB

    @dgelessus

    Here's what I tried, I'm know I'm hopelessly lost.

    #coding: utf-8
    import datetime
    import workflow
    
    action_in = workflow.get_variable('DOB')
    
    delta_t = datetime.date.today() - int(['DOB'])
    
    workflow.set_variable('age') = int(delta_t.days / 365.2425)
    
    action_out = workflow.set_output('age')
    

    posted in Editorial read more
  • NikkiSchwartzVB

    I lied. Not working. :(

    posted in Editorial read more
  • NikkiSchwartzVB

    Hmm... just found the editorial and python documentation... how to use them together. Maybe I can make this work.

    posted in Editorial read more
  • NikkiSchwartzVB

    @ccc that is fantastic, I just saw this... after I mentioned in a different thread. Sorry for the redundancy.

    I saw this in the script, which makes sense... I think the problem is that I don't understand python well enough to know how to make it produce output back to editorial workflows. (Which is obviously not your problem, right ;)

    To clarify, I don't mind asking for help... but I don't want to be that chick who shows up and says, hey guys, can you build me x, y, and z, because I'm so much busier and more important than you to learn it myself. Thanks peace.

    Ya know? Don't want to be that.

    I tried combining these two lines (before you answered) with the pieces of the script in Am I a Minor... but being rather ignorant Of python... it didn't work.

    posted in Editorial read more

Internal error.

Oops! Looks like something went wrong!