I'm creating a folder action to display a notification when a new file is downloaded and would like the notification to display the filename. I can't figure out how to extract the filename of the downloaded file and pass it on to the variable.
1 Answer
Try something like this:
Transcript:
Folder action receives files and folders to Downloads(default Folder Action script)
Run Applescript:
on run {input, parameters} tell application "Finder" set filename to name of file input end tell end run
Set value of Variable: fileName
Ask for Confirmation: Title: Alert! The file fileName has been downloaded! Body: A new file has downloaded
So if I add a file named "NewFile.png", I get:
-
2Alternatively, you could also use a "Display Notification" action, which would be less obtrusive.– aaplmathJul 19, 2015 at 15:24
-