Shell Script in Subfolders

Hello again. 
Thats my status:
Folder1
------- Folder2
-------------picture1.jpg
-------------picture2.jpg
------- Folder3
-------------picture1.jpg
-------------picture2.jpg
------- Folder4
-------------picture1.jpg
-------------picture2.jpg
Folder1 => Hazel runs include Subfolders (Run rules on folder contents)
Script:
The script works fine, BUT: all Pictures got the Titel "Folder1" and not the folder name of each file.
I think the problem is, that the script runs at once, not again in each subfolder.
Thanks in advance for your help
Best regards
Bernd

Thats my status:
Folder1
------- Folder2
-------------picture1.jpg
-------------picture2.jpg
------- Folder3
-------------picture1.jpg
-------------picture2.jpg
------- Folder4
-------------picture1.jpg
-------------picture2.jpg
Folder1 => Hazel runs include Subfolders (Run rules on folder contents)
Script:
- Code: Select all
exiftool $1 -title=$(basename ${PWD}) -overwrite_original
The script works fine, BUT: all Pictures got the Titel "Folder1" and not the folder name of each file.
I think the problem is, that the script runs at once, not again in each subfolder.
Thanks in advance for your help
Best regards
Bernd