I am really in need of a way to find out what window Finder is looking at so for example, if the user opens a certain folder I can get a notification. Is this possible?
Create an AppleScript file with the content
on opening folder theAttachedFolder do shell script "echo 'The folder \"folder name\" has been opened' | mail -s 'folder opened' 'email@example.com'" end opening folder
replace folder name in \"folder name\" with the real folder name, enter a proper email address in the .scpt file and save it to /Library/Scripts/Folder\ Action\ Scripts.
Then configure a folder action with this script by attaching it to the monitored folder. If
mail ... doesn't work in your environment you have to use another CLI mail client. With a working OS X/macOS Server and its configured and running mail server and respective user accounts it works right out of the box.
More advanced version which requires to insert an email address only:
on opening folder theAttachedFolder set theFolder to quoted form of POSIX path of theAttachedFolder set Username to quoted form of short user name of (system info) do shell script "echo 'The folder " & theFolder & " has been opened by " & Username & "!' | mail -s 'Monitored folder opened' 'firstname.lastname@example.org'" end opening folder