Hello,
I’ve been trying to write a script that will only copy a lot of files to a folder… easy enough, but the catch is that I will be making updates regularly, so I do not want to have to re-copy the files that already exsits in the selected folder. I think my method is good, I am just having trouble creating the check to see if file Blah exist in folder Blank.
Here is where I am currently at:
tell application "iTunes"
set this_playlist to the view of browser window 1
set allsongids to (tracks in this_playlist) as list
set thePath to choose folder with prompt "Choose were you would like the files to be saved"
set thePath to (thePath & ":") as string
set thePOSIXPath to (POSIX path of (thePath))
tell this_playlist
repeat with i from 1 to the count of tracks
tell track i
set thesongid to item i of allsongids
set songloc to (location of thesongid)
tell application "Finder" to set filename to (name of songloc)
do shell script "ls" & " " & quoted form of thePOSIXPath
set theList to result
log filename
log theList
if filename is not theList then
do shell script "cp " & quoted form of POSIX path of songloc & " " & quoted form of (thePOSIXPath)
end if
end tell
end repeat
end tell
end tell
Currently, It overwrites the files every time. An ideas on how to get this running?
Thanks,
JO