How to use a folders name in an apple script?

I would like Hazel to download images that have corresponding names to the names of the folders in the monitored folder.
I have a script that should do the job (see below).
The problem is how to alter theFile so it will just contain the folder name without any path or included it.
I hope somebody can help?
Best,
David
I have a script that should do the job (see below).
The problem is how to alter theFile so it will just contain the folder name without any path or included it.
- Code: Select all
set theURL to theFile
do shell script "cd ~/Desktop/Hazel\\ test\\ folder/images; curl -O 'http://somedomain.com/" & theURL & ".jpg'"
I hope somebody can help?
Best,
David