Folder Action Question/Request for Ideas

Hopefully I will be able to explain this clearly.

I manage our company’s digital asset archives. We have one for images (photos, illustrations, photoillustrations). The process works like this. There is a folder on one of the servers where the files get temporarily stored based on what magazine they were created for. To get the files moved in there I wrote an application that users drop their files on. The droplet validates the file for our naming convention and type (it only accepts EPS and TIFF files). If all is well the file is moved to it’s appropriate subfolder within the archive folder. If not, warning messages are displayed with the error and if it is a naming convention the option to edit the name is also allowed. I built another app (upgraded to XCode from AppleScript) that an administrator uses to check the contents of the temp folder, select files to move, make a database record of the files metadata and other info and moves the files to their final location on another server. Been running fine for about four years.

Today I notice someone is circumventing the bearuacracy! There are PSD files in my beloved temp archive folder. Bastards! Don’t they know we have standards in place, a set of conformity they must all accept for the greater good!

OK, dramatics aside I was wondering if there was a way I could place a script on the temp archive folder that only accepts files if they are being moved by the validating script. Basically some sort of handshake process between the two scripts. I’m thinking I can’t because the folder action would be sitting on a network server running some sort of Windows software (probably the latest, beta, untested one, yeah, our IT department does that, a lot) so the action wouldn’t work.

Any ideas or suggestions?

Thanks

I feel your pain! I develop graphics and prepress workflows and it just burns me when someone tries to go maverick! :mad:

I don’t have access to a windows share so I can’t say for sure about the Folder Action.

You could build on idle script that watches the folder and flags you (or an appropriate and trustworthy party) if illegal file types are found. Even with a polling delay of 30 seconds you shouldn’t see too much processing overhead.

Also, if this temp folder is open “to the public” (by this I mean designers :D)I would shut everyone’s permissions off except for yours and the admin’s.

Good luck (and fight the good fight :D)
Jim Neumann
BLUEFROG

P.S. I would go to whatever authority you have to and explain (or re-explain (or re-reexplain)) why this policy MUST be adhered to. Throw some weight around! If you let them slide, they will. -Jim

The folder has to be read/write for everyone (well all 70 or so art people types so their local files can be moved there) so no shutting it down in that sense. The idle idea doesn’t help me out as it is after the fact and unless I can send some voltage through the network to their keyboard would not elicit the proper Pavlovian response (or if Skinner is more your flavor to cause extinction of the operant behavior :D) necessary to stop them from doing it again.

The only thing I can think of is to make an on idle stay open app (like BLUEFROG suggested) that looks at the Archive folder and moves any files it finds that aren’t EPS or TIFF files back up to the main level. I have a basic script outline you can modify to do something like this. I wrote it to pick up XML files but you could easily modify it.

I wonder if you could shut permissions to the sub-folders down and only give your script write access (maybe it passes an admin name and password somehow). The moving command in the script might have to be a shell command to do that. That way everyone would be forced to use your script to add their files.

on idle
	set PathToDesktop to path to the desktop as text
	set DataFolder to (PathToDesktop & "DataFolder") as alias
	with timeout of 9990 seconds
		try
			tell application "Finder" to set these_items to (files of (entire contents of DataFolder) whose kind contains "XML")
		on error
			delay 1
			set these_items to {}
		end try
	end timeout
	--Check to see if there are one or more XML files in the FormData folder on the desktop
	if the number of items in these_items is greater than 0 then
		
		tell me to activate
		display dialog "Files located. Script starting!" buttons " " default button 1 giving up after 1
		
		--Go through all XML files, one at a time
		repeat with XMLfile in these_items
			
			--Process the file
			
			tell application "Finder"
				activate
				try
					delete XMLfile
				end try
				tell application "System Events"
					keystroke "h" using {command down, option down}
				end tell
			end tell
			
		end repeat
	end if
	return 5
end idle

This might be a silly idea, but have you considered making the temp folder invisible in the Finder? If you start its name with a period, the Finder should refuse to show it, even if it’s on a Windows share.

Not sure if Windows will let you do that. The other option is to tell the Mac in question (or all of them) to ignore any folder with a given path (i.e. - “/Developer/Tools/SetFile -a V /Volumes/TheServer/temp”). Note that you need to install the developer tools (or copy just the SetFile command from your own devtools install).

When you can’t use high level tech to do what you want, go down to the metal and do it at a much lower level.:cool:

Hi,
How about you create a folder on the server that has the permissions set to “No Access” for “Others” but allows the “Owner” of the folder to “Read & Write”. The next part would be to adapt your script so that it moves the users files to a .temp folder that’s hidden, as Kevin Bradley suggested. You could then apply a Folder Action to this folder, that’s owned by user that created the folder on the server and have it move the files into it. Hope this makes sense, sorry if I’m missing the point.
Thanks,
Nik

Thanks for all the great suggestions, what a clever and nefarious lot we have here. :smiley:

The powers that be have stepped in and made my life easier by deciding what the hey, we can let PSD files in the archive now.

But the idea of prefixing a folder with the . has given me quite the evil idea to get back at those managers who are thorns in my side. Since I pretty much have access to all the networks I could easily write a script that randomly picks 2 or 3 of their folders, applies the . prefix and then after a delay of 10 minutes removes the . prefix and picks a few more random folders. Folder visible, folders invisible, folders visible, folders invisble. [INSERT EVIL LAUGHTER HERE].

OK, I’m not actually going to do it but it makes me feel like a powerful and vengeful god to think I can…

:smiley:

Users are a notoriously idiotic lot, and managers tend to be the “worst of the worst” when it comes to their ability to use IT resources.

I remember well the chatter in the IT department(s) I’ve worked in - “Such-and-so can’t find his C: drive,” “This nitwit thought fdisk would help him recover a file,” “This guy is rude when you come to fix the mess he made,” etc. And the thought of tweaking their systems to “punish” their stupidity has a certain allure.

However, I’ve never done such, despite the fact that it’s fun to think about. :lol: Instead, we just talk amongst ourselves about “ID 10 T” errors and “PEBCAK” problems.

After all, if they knew what we know, they wouldn’t need us…

Red:
You just keep getting my hackles up! :cool: The “powers that be” deciding that PSD files are OK?!? If they’re like the “powers” that I’ve known for most of my life then they have no legitimate reason to allow this other than their pay grade! I hope whoever they are should be making this call. Just because a bunch of whiners don’t want to get with the program is no reason to change a workflow! :mad::mad:

Dropping the blood pressure.

Ah, I remember the early days of connecting to someone’s machine over the network and making their machine beep a bunch of times when they stepped away (Yes, these were the early, early days! :P) It was fun to see them running back with a worried look and watching it dissolve to confusion.

Keep fighting!
Jim