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.
Is it possible to 'close' a file (preferably through a workflow/script)?
-
I have a python action to move a file from the local library to the dropbox library. It uses
editor.set_file_contents()
to create the copy in Dropbox, and thenos.remove()
to delete the local file, followed byeditor.reload_files()
to update the library.Everything seems to work (ie the file is moved as expected), but a file with that name/contents is open in the editor. If anything changes with this file, it's written back to its original location as a new copy. Is there any way to clear the editor contents or close the file?
The only workaround I can think of is to have a scratch file that I open after the above steps to discard the current contents, but I was wondering if there was something cleaner.
Thanks,
Ed -
You can use an Open URL action and the Editorial URL scheme to open the new version of the file:
editorial://open/yourfilename?root=dropbox
-
Thanks - I was going to do something like that initially, but after moving the file, I wanted to be 'done' with that file if it make any sense?
Right now, I'm going to try and write up something that just opens the next file in the directory, and if there are no more files, then just an empty file.