I manage my accounting via the finder in OSX. I scan all documents and put them into separate folders, each year get's a new folder. Much like I would do this in real life.

It's all good, but sometimes I need to send the tax Office specific documents. For that reason I create another folder where I copy the files they need.

Now: sometimes I forget to copy a file and move it instead. Obviously that's not a good thing.

Could somebody explain me how to create a folder action script that monitors my accounting folder and subfolders and alert me when I either move or delete a file from its folder or subfolders.

The structure is about this:

  • accounting folder
    • year x
      • branch x
        • file x
        • file y
      • branch y
      • branch ...
    • year ...

The alert should give the option to allow it or dismiss it, and maybe show the number of files, or the names of the files involved.

E.g. "Do you really want to move these files?" -> Yes / no / Copy instead*
Or "Do you really want to delete these files?" -> Yes / no*
(* would be default)

I would feel much more comfortable knowing everything in those folders stays in those folders!

Any help appreciated.
I have never touched apple script in my life, but I can program in other languages.

Thanks in advance!

  • Simple workaround, put the new folder on a different volume, then it will always copy unless specifically told to move.
    – Tetsujin
    Commented Oct 24, 2019 at 15:59
  • I know that... and it's not really what I am after... thanks anyways. Also: that won't solve the deleting part, would it?
    – outline4
    Commented Oct 24, 2019 at 16:29
  • 1
    Note that a folder action needs to be attached to each individual folder that you want to monitor, and does not trigger unless the move/delete has already happened.
    – red_menace
    Commented Oct 24, 2019 at 16:33
  • Your best bet then might be some kind of counter. If count changes, alert. It would generate false positives, but might be able to get away with a single 'watch'.
    – Tetsujin
    Commented Oct 24, 2019 at 16:39
  • If somebody has done something similar and can provide a starter template, please raise your hand!
    – outline4
    Commented Oct 24, 2019 at 16:45


You must log in to answer this question.

Browse other questions tagged .