Hi, I've been having some fun over the past couple of days creating new useful buttons, but there's one to help organise my photographs that I'm stumped how to do myself.
I'd like to be able to select some files, and then click a button that will pop up a dialog asking me what to call the new folder. This dialog would ideally have some information from the EXIF data already in as a default filename.
After choosing a name the new folder will be created and all the files I selected would be moved into that new folder.
From what I've seen so far I think this is possible, but I'm not sure how the script would look.
This might get you started. You select one or more files then run the button which should prompt you for a new subfolder name using the first selected file's name as the default. Edit it to be the EXIF name etc you want then press ok and it should create the subfolder and move the selected files into it.
@nofilenamequoting
@set dir = {dlgstring|Enter new subfolder name|{file$|noext}}
createfolder "{$dir}"
Copy MOVE TO ".\{$dir}"
' Change the path below if you haven't installed Opus to the default location:
dim DOpusRTPath
DOpusRTPath = "C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe"
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Dim fFirst
fFirst = TRUE
Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)
Dim name
Dim strDate
Dim strCommand
' Only do the first file.
if fFirst then
fFirst = FALSE
' The strNewName we're given should be something like "D_2007-07-15"
name = ucase(left(strNewName, 2))
strDate = right(strNewName, len(strNewName) - 2)
if (name = "D_" and strDate <> "" and len(strDate) = 10) then
strCommand = """" & DOpusRTPath & """ /cmd Copy MOVE HERE CREATEFOLDER=""{dlgstringS|Enter Directory Name|Photos " & strDate & "}"""
Shell.Run strCommand,0,false
end if
end if
' Set strNewName to an empty string so that Opus does not rename the file.
strNewName = ""
I'd like to bring up this thread again.
Have made a rename preset as follows:
Old Name [* ]
New Name [{shootingtime|D#yyyy-MM-dd}*]
works really fine!
just out of curiosity: for one reason or the other, most context menu-items are not available when handling the files
on the card in my my camera (maybe this is not be the case when the card would in a cardreader, I don't know, I don't have one)
consequently I guess a move to folder named after {shootingtime|D#yyyy-MM-dd} directly from the card in the
camera won't be possible.. (?)
Is your camera shown using a custom view, provided by the camera's software?
If the camera does not appear as a real directory & drive letter then you'll be more-or-less restricted to whatever the camera's software/view provides until you get the files off the camera and on to a normal folder.
You can usually take out the memory card and put it in a generic reader to mount it as a proper drive/directory, though.
Thanks.
The camera does not show up as a drive-letter but with the cameraname, when clicking on my computer.
I can then go to the folders in the right window panel (foldername DCIM\100Nikon). Select the files and copy
them to my harddisk.
Have no software installed. Maybe, one time in future I might buy a cardreader.
This is excellent function. Will help me a lot. I would like to have some things changed to suit my environment.
Is it possible to:
create new folder in the other location D:\Photos 2013\ ?
In this way no matter where the pictures will be located they will be moved to one fixed destination.
change the date format from (yyyy-mm-dd) to (mm-dd)? It would be better for me since a year is already mentioned in the main folder.
add this function to the context menu in Windows? I see that some Opus functions are available under right-click so why not add this one and make life even easier.
Iām bad in programming I will appreciate any help.