我正在嘗試獲取最近使用的應用程序的列表。 NSWorkspace
返回活動應用程序的列表,我可以使用NSRunningApplication
對幾個選項進行排序。見下表:NSRunningApplication,最近使用的應用程序的返回列表?
- launchDate
- finishedLaunching
- processIdentifier
我不想推出日期,但最近的「活動」日期(喜歡的方式CMD - 標籤排序)。 有沒有人知道這個解決方案?
我正在嘗試獲取最近使用的應用程序的列表。 NSWorkspace
返回活動應用程序的列表,我可以使用NSRunningApplication
對幾個選項進行排序。見下表:NSRunningApplication,最近使用的應用程序的返回列表?
- launchDate
- finishedLaunching
- processIdentifier
我不想推出日期,但最近的「活動」日期(喜歡的方式CMD - 標籤排序)。 有沒有人知道這個解決方案?
沒有這樣做,我所知道的沒有任何記載的方式,但我寫你所要求正是使用私有的API:http://gist.github.com/163918
而且,看到Getting the list of running applications ordered by last use對於不使用私有API的解決方案。
你可以看一下蘋果提供的這個樣本:http://developer.apple.com/library/mac/#samplecode/AppList/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008859-Intro-DontLinkElementID_2
在此示例中,他們使用NSRunningApplications類,以獲取有關運行的應用程序的所有數據包。
您好,謝謝你的回答,我會研究這兩種解決方案,它看起來非常有前途! – Martijn 2010-06-14 07:58:26
謝謝,你的代碼很棒!它的私人API太糟糕了。 – 2012-12-07 12:53:28