列出可能打开文件的潜在应用程序

列出可能打开文件的潜在应用程序

本文介绍了列出可能打开文件的潜在应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以获取安装在用户计算机上可用于打开文件(在我的情况下为图像)的应用程序列表,类似于通过Finder的打开方式...菜单显示的列表?

Is it possible to get a list of applications installed on the users computer that could be used to open a file (in my case an image), similar to the list shown through the Finder's "Open With..." menu?

推荐答案

您在寻找程序化或脚本解决方案吗?请参阅( LSCopyAllRoleHandlersForContentType()例如)。对于脚本,你可能需要 lsregister ,它被埋在

Are you looking for a programatic or scripting solution? Programatically, look at Launch Services (LSCopyAllRoleHandlersForContentType() for instance). For scripting, you probably want lsregister which is buried down in

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Support

不要让它在文档中的位置愚弄你。它在Carbon文档中,但它实际上是CoreServices,不过时。

Don't let its location in the docs fool you. It in the Carbon docs, but it's actually CoreServices, which is not deprecated.

这篇关于列出可能打开文件的潜在应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 02:20