Return ticket from Editorial to TextTool back to Editorial
I need the Sentence case, which Editorial’s « Change Case » action does not provide.
I have found the TT case workflow,
which works perfectly, except that it leaves the text inside TextTool, where I must fetch it manually.
I must admit that the effort is not big, but I wish I could automate the journey back in my original document (Gradus.txt in Dropbox, no subfolder).
To be frank, I do not grok the x-callbackurl specification…
How must I proceed ?
Thanks in advance
Just an idea but creating a new work flow which gets the current selection of text and then in Python running ````str.capitalize``` over the selectection.
I must admit I do not know Python.
How am I supposed to insert str.capitalize in the "Run Python Script" action ?
Sorry for being a nuisance...
Don't worry about it @tguillemin
This probably could be a lot more efficient however this is a simple example.
#coding: utf-8 import workflow import editor import os action_in = workflow.get_input() #TODO: Generate the output... action_out = action_in path = editor.get_path() p, file_name = os.path.split(path) doc_drop = os.path.split(p) data = editor.get_file_contents(file_name, doc_drop).split(". ") print data print [x.capitalize() for x in data] editor.set_file_contents(file_name, ". ".join([x.capitalize() for x in data]), doc_drop) editor.reload_files() workflow.set_output(action_out)
Thank you very much. It works as expected.
Have a nice day and thanks again