Tuesday, May 24, 2011

Could not drop a folder onto TextMate's project drawer

I was trying to create a new project in Textmate in the usual way - New Project from the File menu, then drag a folder on to the project drawer in TextMate - but TextMate refused to act as a drop target for the folder. I had a closer look at the folder and its contents and saw that some files in the folder had the Quarantine attribute set. Use
ls -l@
to list the extended attributes.

OS/X sets this attribute when a file is saved from the Browser or an Email. This is what causes the "This file was downloaded from the Internet" prompt that you see the first time you try to open such a file.

I wondered if that was the problem, so I ran xattr command with the recurse flag
xattr -d -r com.apple.quarantine <folder name>
to delete the quarantine attribute from all files in that folder. Thereafter TextMate was happy to act as a drop target for the folder.