Another newbie question: How to find the pathname to files associated with other apps?
I apologize if this is the wrong place to ask something so basic, but I've searched and I'm stumped...
I have some pdf files that I downloaded using the browser's "open_in" capability, that I associated with the Nook app (just because it was convenient at the time...). I would now like to access those files from a Pythonista script, but I can't figure out how to get to them.
I've been trying to use os.listdir() to poke around from the console, and it won't even let me even get a directory listing of most of the directories on the iPad. (Says the operation is not permitted...) I've noticed that some scripts on GitHub do a workaround by putting content files in their repository, and then grabbing them using a script that writes them into one of the Pythonista directories. It seems to me that there should be a better way than physically storing content files in the same directory as the script, and having to go through bizarre contortions to get the files there...
Is there a way to find the path to an arbitrary file that's on the iPad somewhere, and then to use that path to reference the file from within a Pythonista script?
Apple isolates each iOS app from other apps on the device in a technique called
sandboxingwhich is the reason that you get the operation is not permitted message when you try to roam too far from the directory that your script is in. The files that Pythonista deals with directly must be located in the directories of its own sandbox. Modules like dropbox, requests, paramiko, urllib, etc. allow you to import external files into that sandbox.
Im pretty sure it is from apples guide lines. I think Apple does not want somebody to make a script which can change the device, because it would be lost money to them. Say I had an iPhone 4 and could no longer update my iOS because it was outdated and incompatible. I would need to buy a newer iPhone wich is what aple depends on. But with pythonista I could develops something that would be just like that, causing Apple to loose money.
That my NOT be correct, but that's what I think
I did poke around some more and found dropbox_file_picker, which I guess will let me bring files in to the sandbox - haven't tried it yet, but will probably tomorrow. I'm pretty new to iOS devices, and newer still to developing any kind of software on an iOS device, and am developing a real love/hate relationship with Apple.
But, in any case, at least there was a workaround.
Thanks for the responses!