Except that opens the file, which isn't what I want to do.
Maybe I wasn't clear in my initial question. I don't want to open files that match the rule; I want to set the application that will open them tomorrow or next week or a year from now, whenever I double-click on the file in Finder. Basically, as if I had opened the Info window for each matching file and manually set the open with dropdown but, y'know, without actually having to do that manually.
Used to be, in the pre-OS X days, we could set a file's creator code using AppleScript to do this. Using mdls on a file shows there's a kMDItemFSCreatorCode attribute but it doesn't seem to have much effect in my (admittedly limited so far) testing. As far as I've been able to figure out, that info is now stored in the com.apple.FinderInfo extended attribute, but I can't find any way to set it.
So is there any way to script this, which would mean I could include it in a run script action in Hazel?
Also, it seems like this would be a useful addition to the available actions in Hazel.