I am wondering if there is a way to create a Create New Workflow action.
I know workflow files are json files, and figuring the format won't be so hard.
Perhaps a New Workflow from Clipboard action? Or a New workflow from Input action?
I am wondering if there is a way to create a Create New Workflow action.
I know workflow files are json files, and figuring the format won't be so hard.
Perhaps a New Workflow from Clipboard action? Or a New workflow from Input action?
Are you aware that you can already create copies of existing Workflows, in the UI?
What are you trying to achieve?
And what did you have in mind on the Clipboard or Input? A name? A workflow? A JSON string?
It's hard for me to see how this would be useful in practice, so I am wondering if I have misunderstood.
Clare
Well, I can imagine the OP might be contemplating something that builds custom workflows - for example a proforma maker.
One of the beauties of a text-based format is the ability to confect it - which unlocks rather a lot of creative possibilities.
Yes, I want to build custom workflows textually. I could also change variables of a workflow without editing it.
This will indeed open up more possibilities.
I have copied a workflow to the clipboard and edited it in the editor, then copied the text, and created a new workflow from the clipboard. It was a simple test, but I could change variables this way also.
Even if I could get a Copy Workflow action. Or an Update Workflow action....
Thanks for the replies - here's another use case:
Here's some steps that gave me a suggestion for how to get most of the way with implementing this:
This is what the content looks like, for a workflow called "My Workflow", with a single HUD display that says "Hello World".
------------ BEGIN WORKFLOW ------------
{
"actions" : [
{
"class" : "WorkflowActionShowHUD",
"pauseBeforeRunning" : false,
"customTitle" : "",
"parameters" : {
"icon" : 0,
"duration" : 0,
"HUDText" : {
"tokenRanges" : {
},
"type" : "advancedText",
"text" : "Hello World"
}
},
"pauseWithoutShowingParameters" : false
}
],
"name" : "My Workflow"
}
------------- END WORKFLOW -------------
How to use this programmatically:
BEGIN WORKFLOW and END WORKFLOW linesAll the alternative approaches I'd considered involved:
.wkflw file, Commands.edcmd on Editorial's folder in the iOS file systemuuid/GUID magic strings used for naming the .wkflw files - in order to generate new filesSo far, I haven't managed to persuade it to accept comment or tags values via this route - it really does only seem to extract actions and name:
"name" line, the content wasn't recognised as a Workflow."name" line, the content was recognised OK as a Workflow, but the extra values were ignored.@ ClareMacrae
editor.get_path() allows you to get the path of the current document.
I have been working on a few file Managment workflows myself using the os module.
I can delete the current file, add a new file to the file list, and rename the current file via workflows.
I just don't know how to interpret the workflow file names.