Forum Archive

appex save file vs homescreen/in editor save file

khilnani

(first post, great app and amazing community, learned a lot from everyone else's contributions. )

I'm noticing the path to the ~/Documents folder is different when my script is run via appex share 'Run in Pythonista' vs. from launch Pythonista via the home screen and running the same script

Share menu run in Pythonista - /private/var/mobile/Containers/Data/PluginKitPlugin/ID/Documents
Normal Pythonista - /private/var/mobile/Containers/Shared/AppGroup/ID/Documents

i'm, using os.expanduser('~/Documents') - is this not the correct way to access the documents folder? or, is there a way to get to the regular Pythonista Documents folder

The script i'm using is at https://github.com/khilnani/pythonista-scripts/blob/master/extensions/save-url.py

Thanks!

JonB

what version are you running?

In a recent version(maybe the beta), the appex and main app share the documents folder.

khilnani

i'm running v2.0 (200003)

thx

khilnani

Using cwd helped -

DOCS_DIR = os.getcwd().split('Documents')[0] + 'Documents'