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.
Save Script via Open In directly to Pythonista
-
Thanks a lot @Tizzy, now I want to add the open in .pyui files too.
-
@mncfre Just tried this an got a list index out of range error.
-
TJ, were you in Downloads.app and do an
Open in...
Workflow.app as is described in the first post in this thread?If you just run this script in Pythonista with no argv parameters, you will get a list index out of range error.
-
Still trying to save the .pyui but workflow seems to manage the .pyui as binary, I can't use the clipboard for now and I don't like the dropbox solution, if some of you have some idea please tell us here.
-
Just rename the pyui as text or py. It is a pure textfile.
-
Thats a good idea but I'm looking for a more automatic solution that avoid changing the extension manually, I'm gonna try something like that but in workflow
-
Script updated to ask file extension, using the @JonB suggestion, so if you have a .pyui change its extension to .py then “open in” then in pythonista select .pyui extension, it’s not perfect but it’s all I have now.
-
@ccc I was in Dropbox. Wishful thinking :[
-
@techteej that's because when you "open in" from Dropbox it actually don't open the file, it generate a link of the file, in theory I can do a workflow especially for Dropbox of you need it
-
If using this with the dropbox app, you just need to add a step. Tap share>open in>run workflow instead of going directly to run workflow.
I have updated both the script and the workflow. The changes are as follows:
Workflow: I kept getting the wrong file name, so I updated the workflow to pass the right file name to pythonista. I also made the Documents folder the default with the option to add to the path. I don't know if the way I set up the default folder will be the same on all devices or not.
Script: I changed the system argument index, which was giving me an out of range error and made it so that instead of printing the path, the file is opened once it is created. Finally, I made an option for other file types where you can type in the file extension.
-
Workflow: I kept getting the wrong file name, so I updated the workflow to pass the right file name to pythonista. I also made the Documents folder the default with the option to add to the path. I don't know if the way I set up the default folder will be the same on all devices or not.
Script: I changed the system argument index, which was giving me an out of range error and made it so that instead of printing the path, the file is opened once it is created. Finally, I made an option for other file types where you can type in the file extension. Script
-
I get an error running this script
No such file directory -
@jaredbidlow, Pythonista 2.0 provides appex, so you don't need Workflow and the clipboard anymore to Open in Pythonista. See e.g. https://forum.omz-software.com/topic/2494/appex-getfromurl-to-share-from-other-apps-to-pythonista for an alternative
-
@jaredbidlow This is almost completely useless now. There's a much simpler way to do this now that doesn't require Workflow.
-
Or see Save Attachment
-
I've updated this script, as well as the associated Workflow, to make it more reliable and work with Pythonista 2, as well as allow for replacing the file extension on save. https://gist.github.com/ScottSmith95/2f9b249f9e6e0e9fc6ef