[Pythonmac-SIG] How do you find the app that matches a creator type

has hengist.podd at virgin.net
Mon Jan 31 14:17:40 CET 2005


Read Roberts wrote:

>Now that mcfs.py is deprecated, what is an alternative  for the now 
>unsupported FindApplication?

from LaunchServices import LSFindApplicationForInfo
from Carbon.CoreFoundation import kCFURLPOSIXPathStyle

creator = 'ttxt'
path = LSFindApplicationForInfo(creator, None, None)[1] \
         .CFURLCopyFileSystemPath(kCFURLPOSIXPathStyle).toPython()
print path

LaunchServices is due for inclusion in MacPython 2.4. Meantime, you 
can find it on SourceForge CVS or just use the pre-packaged copy from 
my site:

http://freespace.virgin.net/hamish.sanderson/appscript.html

HTH

has
-- 
http://freespace.virgin.net/hamish.sanderson/


More information about the Pythonmac-SIG mailing list