I have again a typical AppleScript dummy issue. The following script should work only on the files matched by my Hazel condition. But now, it copies all files contained in the folders which are defined in the CSV file.
- Code: Select all
on hazelProcessFile(theFile)
set collectAllFolderPath to "Pic Archiv:Upload PM:Rename PM Test:"
set pathPairs to paragraphs of (read (alias "Pic Archiv:Upload PM:Workflows:RenameFolders.csv"))
repeat with i from 1 to count of pathPairs
set currPaths to item i of pathPairs
set AppleScript's text item delimiters to ";"
set theSource to text item 1 of currPaths
set theDest to text item 2 of currPaths
set logOne to backup alias theSource onto alias theDest level 2
set logTwo to backup alias theSource onto alias collectAllFolderPath level 2
set AppleScript's text item delimiters to ""
end repeat
end hazelProcessFile
And here are a few lines out of my CSV file, just as an example:
- Code: Select all
Pic Archiv:10 Austria:Zauchensee:;Pic Archiv:Upload PM:Rename CSV:001 Hotels:y-y-AT-AT-VIE-000-y-y-y-y-u:
Pic Archiv:11 Germany:Muenchen:;Pic Archiv:Upload PM:Rename CSV:001 Hotels:y-y-DE-DE-MUC-223-y-y-y-y-u:
Pic Archiv:01 Hotels HR:Delnice:;Pic Archiv:Upload PM:Rename CSV:001 Hotels:y-y-HR-GK-GRK-173-y-y-y-y-u:
Pic Archiv:01 Hotels HR:Brtonigla:;Pic Archiv:Upload PM:Rename CSV:001 Hotels:y-y-HR-IS-PUY-000-y-y-y-y-u:
Does anybody have a clue what and where to tell the AppleScript to work on the matched files only? I suppose it must refer to the variable "theFile".
Thanks,