Sample Header Ad - 728x90

Applescript to return name of new file added to folder

1 vote
1 answer
1348 views
This is mostly a test so that I can work up to the function that I want to create down the line. I'm very new to AppleScript so bear with me! I wrote this as an attempt to test a folder action that receives a new file and then displays an alert with the name of the newly added file. This Script was saved to ~/Library/Scripts/Folder Action Scripts. And then assigned to a folder on my desktop called Return Name. I see the script run when a new item is dropped in but nothing happens. Can anyone just explain to me what is wrong here? Thanks! on adding folder items to InputFolder after receiving NewItem tell application "Finder" set FileName to name of NewItem activate display alert "New Items Added!" message ("File called " & FileName & " have been added" as string) end tell end adding folder items to
Asked by branarama (53 rep)
Oct 4, 2018, 02:05 PM
Last activity: Feb 15, 2019, 08:45 PM