Sometimes the simplest task won’t work:
on adding folder items to this_folder after receiving added_items
repeat with theFile in added_items
set filename to name of theFile <--generates an error!
.....
My reasoning is:
added_items is a list of aliases
Therefore: theFile is an alias (alias “Macintosh HD:Users:vml:Desktop:test.doc”)
Therefore: I should be able to get the name of the alias! (test.doc)
I worked around the problem like this:
set AppleScript's text item delimiters to {":"}
repeat with theFile in added_items
set filename to theFile as string
set filename to the last text item of filestring
It works, but I’m sure it could be done in a better way! How?