transfer files to another folder based on file extension

Get help with using AutoHotkey and its commands and hotkeys
reverberation
Posts: 122
Joined: 13 Dec 2015, 20:48

transfer files to another folder based on file extension

19 Sep 2019, 21:25

Requirements as follows:

1. Actively monitor folder for "jpg" extension (without using loop command, so that it doesn't always tax the system. I only want it to trigger when there are new files in the Download Folder)
2. When jpg detected, CUT and paste it to a different folder (e.g. C:/Photos)

Has anyone done this before? Any sample script will be most appreciated, thanks!
User avatar
Xtra
Posts: 1446
Joined: 02 Oct 2015, 12:15

Re: transfer files to another folder based on file extension

19 Sep 2019, 23:57

https://www.autohotkey.com/boards/viewtopic.php?f=6&t=8384&hilit=watchfolder

When it detects a change run a Filemove routine using a filepattern for the source location.
reverberation
Posts: 122
Joined: 13 Dec 2015, 20:48

Re: transfer files to another folder based on file extension

20 Sep 2019, 19:26

Hi, will you be so nice as to post a sample script please? I am not sure how to run the routine while checking the file extension..
User avatar
Xtra
Posts: 1446
Joined: 02 Oct 2015, 12:15

Re: transfer files to another folder based on file extension

20 Sep 2019, 20:35

Download:
WatchFolder.ahk
WatchFolder_sample.ahk

In the sample script add:
FileMove, % A_ScriptDir . "\*.jpg", % A_ScriptDir . "\MoveToFolder"
To the bottom of the MyUserFunc() function
(Change FileMove Source folder and Path to a folder of your choice)
(Change FileMove Destination folder and Path to a folder of your choice)

Run the sample script and select the folder to watch
Click Start button and start putting .jpg's in the watched folder.

You can edit sample script down from there if you do not want the GUI with listview.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boiler, Bort P, Google [Bot], Marcosa1020 and 200 guests