Copy video file from phone Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
haomingchen1998
Posts: 176
Joined: 20 Feb 2023, 16:37

Copy video file from phone

Post by haomingchen1998 » 08 Oct 2023, 17:48

Code: Select all

GetDeviceFolder(deviceName) {
    shell := ComObjCreate("Shell.Application")
    computer := shell.Namespace("::{20d04fe0-3aea-1069-a2d8-08002b30309d}")
    for item in computer.Items
        if item.Name = deviceName
            return item.GetFolder()
}
DeviceFileCopy(src, dest) {
    src := StrSplit(src, "\", , 2)
    dest := StrSplit(dest, "\", , 2)
    
    GetDeviceFolder(src[1]).ParseName(src[2]).InvokeVerb("copy")
    GetDeviceFolder(dest[1]).ParseName(dest[2]).InvokeVerb("paste")
}

DeviceFileCopy("OnePlus 7 Pro\Internal shared storage\Download", "Video (V:)\Video\Temp")
How can I modify this code, so that it only copies the video files from my phone to my laptop? Thanks!

User avatar
davebrny
Posts: 85
Joined: 05 Dec 2016, 06:26

Re: Copy video file from phone  Topic is solved

Post by davebrny » 09 Oct 2023, 16:17

haomingchen1998 wrote:
08 Oct 2023, 17:48
How can I modify this code, so that it only copies the video files from my phone to my laptop? Thanks!
have a look at the example here: viewtopic.php?t=110506#p491922

its similar to the code you have but it adds the option of using a * wildcard so you can add something like \Download\*.mp4

haomingchen1998
Posts: 176
Joined: 20 Feb 2023, 16:37

Re: Copy video file from phone

Post by haomingchen1998 » 09 Oct 2023, 19:57

davebrny wrote:
09 Oct 2023, 16:17
haomingchen1998 wrote:
08 Oct 2023, 17:48
How can I modify this code, so that it only copies the video files from my phone to my laptop? Thanks!
have a look at the example here: viewtopic.php?t=110506#p491922

its similar to the code you have but it adds the option of using a * wildcard so you can add something like \Download\*.mp4
Thank you so much for pointing me to the right direction, I'm finally able to make it work for me!

Post Reply

Return to “Ask for Help (v1)”