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.
Bugs with latest beta
-
Thank you for your response! It's not really vital for my purposes, I just wanted to make sure that it wasn't just me. I'm really enjoying some of these new features. I feel like I've just barely scratched the surface.
-
How do you reccommend that I fix the photos bug? This has only changed when I updated...
-
And I wanted to use editor in appex to convert your download gist script to a safari app extenion
-
webmaster, it would be possible to call
pythonista://
from appex to run a script in the main app. that is how the old bookmarklet worked. -
@JonB Unfortunately, that is not possible.
webbrowser.open()
doesn't work in the extension (and as far as I'm aware, it's technically not possible to make it work there). -
Another application is this script I wrote to duplicate a file in pythonista.
import appex path = appex.get_url()[7:] filename = path.split('/')[len(path.split('/'))-1] newpath = path[:len(path)-len(filename)]+'duplicated-file.py' file = open(path) newfile = open(newpath, 'wb') newfile.write(file.read()) file.close() newfile.close()
It is designed to be run by selecting a file in pythonista and pressing share. It (theoretically) gets the contents of the shared file, and puts them into a new file in the same directory.
But it doesn't work because it says it doesn't have permission.
-
appex scripts cannot access the main app folders. if you want the ability to copy pythonista scripts to appex, your approach would work, but not if you want to copy tem into te same folder.
what you want is a "File Action". check settings for File Actions. This lets you put a custom script in the share sheet of the file browser, and it passes filenames in the sys.argv. then you'd do the same thing, just wthout using appex, and using sys.argv instead of getting the appex url.
-
For the mainipulations of filename, str.partition() might be better than str.split().
-
-
I'd generally recommend using
os.path.split
for file paths, though it only really makes a difference if you write something that's supposed to run on Windows as well (which uses'\'
as the path separator). -
Str.partition() goes left-to-right and str.rpartition() goes right-to-left.
-
Ok. Makes sense now.