On Oct 6, 2005, at 3:33 PM, Mats Persson wrote:
On 6 Oct 2005, at 18:38, Samuel DeVore wrote:
It looks like you code assumes that TextMate is in the users applications folder rather then the root level one
Nope it should look for it in two locations.
- /Applications/Textmate.app/ and then if IT can't find it there,
- it assumes that it's in your ~/Applications/Textmate.app/ location.
It could be better written, but that's what it is right now. IF your app is installed elsewhere, then it won't work I guess :)
Tested with app in both locations on my system, and it worked fine.
It's not as fast as you might like, but you could try running
mdfind 'kMDItemFSName = "TextMate.app" and kMDItemContentType = "com.apple.application-bundle"'
to find all installed copies of TextMate (you'd probably just want to take the first entry found). Also it would only work on Tiger.
It would be even better to simply query LaunchServices, but that requires writing a command-line utility with Xcode to be able to do. It's certainly feasible, it just may be outside the scope of what you're trying to do.