Hi guys,
I already searched a lot but cannot find a solution. I have a list of files on an external drive and want them all to be copied into one certain folder, e.g. "/Volumes/Data/all_not_imported_files"
Here are my Targets: if the filename is the same, still move the file from the source to the target folder but add a number to the new name and leave the file extension untouched.
Additional Information: the files are files that have not been imported to iphoto due to the wrong file formats. Most of them are videos, but not all. And some videos have been imported. The whole thing is about importing videos and pics to iphoto from an old library and move all not imported files to one folder. After that I can begin to convert this files and import them afterwards.
Do you have any ideas? I already tried the following, but the name of the file can not be read...
I already searched a lot but cannot find a solution. I have a list of files on an external drive and want them all to be copied into one certain folder, e.g. "/Volumes/Data/all_not_imported_files"
"/Volumes/Data/Vids/Video0270.mp4"
"/Volumes/Data/Vids/Video0271.mp3"
"/Volumes/Data/Vids2/Video0270.pdf"
"/Volumes/Data/Vids2/Video0271.doc"
the list is pretty long, therefore I thought automation with apple script would be great. However, I do not understand how to use this list with apple script using the right syntax. "/Volumes/Data/Vids/Video0271.mp3"
"/Volumes/Data/Vids2/Video0270.pdf"
"/Volumes/Data/Vids2/Video0271.doc"
Here are my Targets: if the filename is the same, still move the file from the source to the target folder but add a number to the new name and leave the file extension untouched.
Additional Information: the files are files that have not been imported to iphoto due to the wrong file formats. Most of them are videos, but not all. And some videos have been imported. The whole thing is about importing videos and pics to iphoto from an old library and move all not imported files to one folder. After that I can begin to convert this files and import them afterwards.
Do you have any ideas? I already tried the following, but the name of the file can not be read...
Code:
set theFile to "Data:Vids:Video0270.mp4"
set theDestinationFolder to "Data:all_not_imported_files"
tell application "Finder"
set theFileName to name of theFile
set thePathToCheck to theDestinationFolder & theFileName as string
if item thePathToCheck exists then
set theSuffix to 1
repeat
if (item (thePathToCheck & theSuffix) exists) = false then exit repeat
set theSuffix to theSuffix + 1
end repeat
set name of theFile to theSuffix & theFileName
end if
move theFile to theDestinationFolder
end tell