>What about this?  The script should be a watched folder script.  Instead 
>of deleting the .DS_Store file, why not see if .DS_Store file exists and 
>if it does, find the owning folder of the Temp Incoming folder and then 
>delete the Temp Incoming folder complete.  Before deleting the folder the 
>script should check if it contains other files (which it shouldn't).  You 
>could bring up a dialog box warning the user to move these other file 
>into a new Temp Incoming folder without opening it and then delete the 
>old one.  

I was kind of thinking of a nice simply folder action. Everytime a new 
item is added to the folder, simply delete the ".DS_Store" file. If no 
file exists, do nothing.

I don't know what kind of a performance hit that would have when adding 
files, but probably nothing major. And that way, it always makes sure 
that a DS Store file can't appear and block unpacking (because the last 
file added before Emailer tries to unpack will once again delete the DS 
Store file if it exists).

My two problems with this were 

A: how to activate Folder Actions on the Temp Incoming folder (once again 
VRic came to the rescue with some links, I'm just too tired right now to 
really check them out), 

and B: How to get the path to the Temp Incoming folder. I'm not sure 
where Folder Actions store their scripts, so I wasn't sure how it would 
effect things. You can't just go off an unspecified location which from 
the looks of the examples out there will be taken as "this folder". The 
reason you can't do that is because that relies on the Finder to delete 
the file, but the Finder doesn't see dot files at all. So it needs to be 
done via the do shell script command, and that starts itself at the root 
level, so you need to give it the path to the file you want to delete.

In my other script, I used the Path to Me to find the path to the running 
Emailer application that called the script, and from there was able to 
build the path to the Temp Incoming folder using some blanket assumptions 
(that is, that most users leave the folder in its default location... and 
that I am too ignorant to deal with other languages). IF the path to me 
returns the location of the folder the folder action is attached to, then 
that will work, but I honestly have NEVER used a folder action before 
(not even in OS 9), so I didn't know how they delt with stuff like that.

-chris
<http://www.mythtech.net>

___________________________________________________________________________
To unsubscribe send a mail message with a SUBJECT line of "unsubscribe" to
<[EMAIL PROTECTED]>  or  <[EMAIL PROTECTED]>

Reply via email to