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.
How to rename UI Editor files pyui in Editorial
-
I'm working on getting started with Python workflow actions in Editorial 1.3 (130012) and following he UI designer tutorial in the Editorial docs.
Step 6 has me stumped: "For the code below to work as is, rename the UI file to “My UI”."
I've been looking around for some time and can't find a way to change the UI file name.
In the UI Editor, I changed the title of the view area to 'My UI', and I've renaming a new Workflow to 'My UI', but still see:
Traceback (most recent call last):
File "/var/mobile/Containers/Data/Application/HEX/Library/Application Support/Commands/workflow_action_tmp.py", line 6, in <module>
ui.load_view('My UI').present('sheet')
File "/var/containers/Bundle/Application/HEX/Editorial.app/Frameworks/Py2Kit.framework/pylib> /site-packages/ui.py", line 391, in load_view
with open(pyui_path) as f:
IOError: [Errno 2] No such file or directory: 'My UI.pyui'Any pointers for how to proceed? Thanks!
-
The documentation is incorrect there, it's not actually possible to rename UI files in Editorial. The Python-related documentation is largely identical to the Pythonista documentation, but in this particular case, Pythonista has features that Editorial doesn't have. Sorry about the confusion!
In Editorial, every Run Python Script action can only have one associated UI, and script actions don't really have file names. You can just assume that the UI file has the same name as the script, so you should only use
load_view
without a filename argument. -
Thanks! Changed line to:
ui.load_view().present('sheet')
And it worked as expected. Yay!