Hi. I'm completely loving Editorial 1.1. And I'm having fun experimenting with workflows. But I'm not such a savvy python coder... Here is a particular workflow I'm struggling with:
What I'd like to do is rename the current file (stored in dropbox) with an additional prefix. For instance, if the current dropbox file is named "my-document.txt", I'd like to change it to "archive-my-document.txt". Is this possible? To rename the current document?...
I'm thinking I'd use os.rename(src,dst) but I'm not sure what to plug in for the current filename. Do I want the entire path name or just relative to the root dropbox folder? Would I use editor.get_path() or os.path.basename(editor.get_path()) or the "Get Current File Name" action? None of this seems to work so far.
Can anyone help me figure out the code (or actions) necessary to get the correct filename in order to rename it?
Oh. Cool. That didn't occur to me. Thanks. Plus, I see there are actually actions for "get file contents" and "set file contents". I don't have my iPad with me right now but I think this could work:
(Action) Get current file name -> Set variable
(Action) Get file contents -> Set variable
(Action) Set file contents (with new file name)
(Action) Open new file
(Python) Delete old file
Thanks for the feedback.