2

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 1

3

Try something like this:

Picture

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: Example

2
  • 2
    Alternatively, you could also use a "Display Notification" action, which would be less obtrusive.
    – aaplmath
    Jul 19, 2015 at 15:24
  • That would work as well. Jul 19, 2015 at 15:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .