Python script to back up Photos to SD card or HDD
@mikael No, and I don't understand why Files app shows the usb connections but Pythonista "open external" does not 😢
Édit: it is accessible if you, in Files app, manually select a file and share to a Pythonista script.
FlyingDiver last edited by
Maybe it wasn't clear in my original post. I'm planning on doing the import using the Photos app. Then some initial culling of images. Then I want a script to backup any new images to external media. @cvp's post shows me how to get the images, which is great. But currently Pythonista can't write to the external media? I would have to use iOS "Share" to copy them from Pythonista's sandbox to the external media?
@FlyingDiver Assume you import your photos in the photos app.
The script shows how to import them from the photos app to a Pythonista folder.
Yes to "I would have to use iOS "Share" to copy them from Pythonista's sandbox to the external media?"
Then, in Pythonista, you can copy a folder to an external device like I also show
@FlyingDiver Personally, I plug an USB drive/flash to an usb slot of my router and I'm able, via SMB, to copy local Pythonista files to a folder of my external drive.But, I agree that in holiday/trip you don't have a router
Hoping next version of Pythonista will allow access to USB drives
dialogs.pick_document() does not show an usb Drive but shortcut command "get file" shows it, thus I think it could be possible, but perhaps with iOS 13 functions in future Pythonista version.
@FlyingDiver with the new beta, and thus in the v3.3 arriving begin of next week, you will be able to open an external folder on an usb Drive (flash, sd, Drive) connected to your iPhone/iPad, and thus save on it your local photos.
mikael last edited by mikael
@FlyingDiver, thus, a script like this should now be feasible:
- (After you have imported and edited the photos.)
- Opens the photo gallery.
- You pick the first photo that should be backed up.
- That photo and all newer photos are copied to the external drive, potentially to a specific folder created with today’s date or a running number.
Would that fit your use case?
@mikael it is what does my little scrip above, you only need to add a path in the file write, a path like some posts above.
mikael last edited by
@cvp, yes, indeed. I was just thinking about the usability, i.e. visually picking the first image to be saved.
@mikael ok, sorry. Wen I go in holidays, I always backup my photos from my camera to my iPad, until now via wifi, via usb in the future. But often, I have a lot of photos per day and it is sometimes difficult to say/pick which is the first to save visually. And I give the today date (I back up in the evening) and it is done.
jmv38 last edited by
@cvp what camera do you use? Just curious.
@jmv38 Panasonic Lumix DMC-TZ40
Kasarka last edited by Kasarka
This post is deleted!