View Single Post
Old 10-28-2023, 01:15 AM   #7
tomsem
Grand Sorcerer
tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.
 
Posts: 6,944
Karma: 27060153
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
On Mac, I have found a command line tool that lets you copy files from and to, create new folders and delete files/folders. Maybe Linux too?

https://github.com/libmtp/libmtp

Homebrew install is

brew install libmtp

It installs a bunch of mtp-* commands, including mtp-sendfile, mtp-getfile, map-files, mtp-folders, mtp-filetree, mtp-delfile, etc.

You can use filenames or fileID (returned by mtp-files or mtp-filetree) in the commands. But it seems only to operate on one file at a time: no 'copy folder'.

Unlike GUI clients like AFT or OpenMTP or calibre, it does not connect persistently (why can't those clients drop connection after each operation?).

On Windows, you can use PowerShell commands to automate Explorer. I have not explored this yet.

So it's good news: automation is feasible. I'm planning to work on a Python wrapper to make it easier to implement some use cases (e.g. back up/restore notebooks).

Last edited by tomsem; 10-28-2023 at 01:19 AM.
tomsem is offline   Reply With Quote