hi,
before diving into a new project, i wonder if there is something (or similar) already existing for...
copy images from camera to computer
should do:
- select source folder.
- select target folder.
- go over all files in source folder & sub to read file name and creatrion time
- from image creation time make a folder name
- go to target folder and check if this folder (by date) name exist, if no than create it
- in this folder check if a file with same name & creation time exist...
- if no than copy the image.
is there such a thing?
or similar to be base for me?
TNX.
copy images from camera
Re: copy images from camera
someone? please?
Re: copy images from camera
sounds good
make you own one
make you own one
Re: copy images from camera
For the folders I think you don't need to select anything.
You could specify the source and the target folders (or do they really change)?
Regarding the creation time you can work with FileGetTime
Save this value to a helper variable.
Loop, Files, targetFolder, D will list through the target folder.
You can compare every folder with the value of your helper variable (if-statement)
After that, if none was found, use FileCreateDir.
All those commands can be found in the Documentation:
https://www.autohotkey.com/docs/commands/FileGetTime.htm
But honestly, there's a lot of things to do.
I think this is too much for a beginner.
Try to create something easier...
Once you have some good experience and knowledge, you might create such a script without problems.
Or beg IMEime to code it for you
Cheers!
You could specify the source and the target folders (or do they really change)?
Regarding the creation time you can work with FileGetTime
Save this value to a helper variable.
Loop, Files, targetFolder, D will list through the target folder.
You can compare every folder with the value of your helper variable (if-statement)
After that, if none was found, use FileCreateDir.
All those commands can be found in the Documentation:
https://www.autohotkey.com/docs/commands/FileGetTime.htm
But honestly, there's a lot of things to do.
I think this is too much for a beginner.
Try to create something easier...
Once you have some good experience and knowledge, you might create such a script without problems.
Or beg IMEime to code it for you
Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Re: copy images from camera
tnx...
me not realy a beginner i did already wrote some nifty ahk scripts (few years ago)
i loved it and know the power and ease of dev of it.
just thought there must be something similar, or some script to start with...
or...
IMEime - i beg you...
me not realy a beginner i did already wrote some nifty ahk scripts (few years ago)
i loved it and know the power and ease of dev of it.
just thought there must be something similar, or some script to start with...
or...
IMEime - i beg you...
-
- Posts: 264
- Joined: 09 Mar 2019, 01:52
- Location: Germany
- Contact:
Re: copy images from camera
Go for it. Scr1pter gave you the solution in pseudocode. You only have to write it down.
Take your shot and if something doesn't work or your stuck you can ask the detail.
Take your shot and if something doesn't work or your stuck you can ask the detail.
Re: copy images from camera
ok...
first problem...
in source folder i have hundreds of files, in target folder i have thousands of files
what would be the best and fast way to check if a file in source exist or not in target?? (unique by file name & creation time)
a loop within a loop?? that would be very not effecient
got some other idea?
first problem...
in source folder i have hundreds of files, in target folder i have thousands of files
what would be the best and fast way to check if a file in source exist or not in target?? (unique by file name & creation time)
a loop within a loop?? that would be very not effecient
got some other idea?
Re: copy images from camera
How can the target folder contain thousands of files, if the folder names are the creation time?
I highly doubt you shoot 1000+ photos a day.
Perhaps it makes more sense to extract the date of the files.
It means your target folder will have folders of each day you shot pictures.
E.g.:
Folder 1: 2019-01-25
Folder 2: 2019-01-31
I don't think you can say that A loop within a loop is not efficient.
Depends on the case.
To check if a file exists, there is a function named, well, FileExist()
https://www.autohotkey.com/docs/commands/FileExist.htm
P.S.
Instead of coding, try to create some flow diagram (Word, Paint or wherever) and post it.
Then both you and we will exactly know how the workflow should be like.
Cheers!
I highly doubt you shoot 1000+ photos a day.
Perhaps it makes more sense to extract the date of the files.
It means your target folder will have folders of each day you shot pictures.
E.g.:
Folder 1: 2019-01-25
Folder 2: 2019-01-31
I don't think you can say that A loop within a loop is not efficient.
Depends on the case.
To check if a file exists, there is a function named, well, FileExist()
https://www.autohotkey.com/docs/commands/FileExist.htm
P.S.
Instead of coding, try to create some flow diagram (Word, Paint or wherever) and post it.
Then both you and we will exactly know how the workflow should be like.
Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Re: copy images from camera
i tought it might be more effecient to:
1) check if file from source (& subs) not exist in target (& subs)
2) show a list of "not existing"
3) act on that list only... make folder, etc
question arise:
a) can FileExist() search also in sub folders? how?
b) what does FileExist() check for? only same file name? name&size? or... ?
1) check if file from source (& subs) not exist in target (& subs)
2) show a list of "not existing"
3) act on that list only... make folder, etc
question arise:
a) can FileExist() search also in sub folders? how?
b) what does FileExist() check for? only same file name? name&size? or... ?
-
- Posts: 264
- Joined: 09 Mar 2019, 01:52
- Location: Germany
- Contact:
Re: copy images from camera
Start with this
In the source the file are named:
2019-03-26-001.jpg
2019-03-27-001.jpg
2019-03-27-002.jpg
2019-03-27-003.jpg
In the source the file are named:
2019-03-26-001.jpg
2019-03-27-001.jpg
2019-03-27-002.jpg
2019-03-27-003.jpg
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
source := "D:\tmp\source\"
target := "D:\tmp\target\"
Loop Files, %source%\*.jpg, R ; Recurse into subfolders
{
sdate := StrSplit(A_LoopFileName, "-")
syr := sdate[1]
ymt := sdate[2]
sdy := sdate[3]
scn := sdate[4]
;MsgBox, %syr% %ymt% %sdy% %scn%
tfolder := target . syr . "-" . ymt . "-" . sdy
if FileExist(tfolder)
{
FileMove, %source%\%A_LoopFileName%, %tfolder%
}
else
{
FileCreateDir, %tfolder%
FileMove, %source%\%A_LoopFileName%, %tfolder%
}
}
MsgBox, Done
Re: copy images from camera
This may inspire you https://www.autohotkey.com/boards/viewtopic.php?f=76&t=17655&hilit=camera
Donec Perficiam
Re: copy images from camera
here is what i got for a start
what you think?
what you think?
Code: Select all
#SingleInstance force
#NoEnv
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%
sourceFolder := % A_Desktop "\XXX"
destinationFolder := % A_Desktop "\AAA"
result := CopyFiles(sourceFolder, destinationFolder)
MsgBox % result.successCount " files copied`n" result.errorCount " files not copied"
CopyFiles(srcF, dstF)
{
errorCount = 0
successCount = 0
Gui, Add, ListView, r20 w700, Name|Size|formatedTime|msg
Loop, Files, %srcF%\*.*, R
{
msg =
FormatTime, formatedTime, %A_LoopFileTimeCreated%, yyyy-MM-dd
tfolder := dstF . "\" . formatedTime
FileCreateDir, %tfolder%
FileCopy, %A_LoopFileLongPath%, %tfolder%, 0
if ErrorLevel
{
msg = could NOT copy %A_LoopFileFullPath% into %dstF%.
errorCount ++
}
else
{
successCount ++
msg = Success
}
LV_Add("", A_LoopFileName, A_LoopFileSizeKB, formatedTime, msg)
}
LV_ModifyCol()
Gui, Show
return {errorCount: errorCount, successCount: successCount}
}
Re: copy images from camera
i have uploaded my code to github
feel free to improve on it, add stuff, etc.
https://github.com/Shemesh/CopyFilesByDate
feel free to improve on it, add stuff, etc.
https://github.com/Shemesh/CopyFilesByDate
Re: copy images from camera
DONE! finished
here is the final app: https://github.com/Shemesh/CopyFilesByDate
here is the final app: https://github.com/Shemesh/CopyFilesByDate