Page 1 of 1

How to use a folders name in an apple script?

PostPosted: Tue Aug 08, 2017 5:10 pm
by nebaon
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.

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

Re: How to use a folders name in an apple script?

PostPosted: Wed Aug 09, 2017 4:19 pm
by Mr_Noodle
Since this is a more general AppleScript question, you are probably better off doing a google search on it as there are various resources on the net.