Friday, December 15, 2017

#1 2017-11-27 01:14:59 pm

Joy
Member
From:: South Tirol
Registered: 2008-07-04
Posts: 541
Website

Application hierarchy - like in the heads-up menu

Many times I wanted sorted applications, as seen in the heads-up widget with :
cmd+tab

Till now I found no way to access some sort of list with 1St, 2nd, 3rd process and so forth. Some ideas or suggestions?

Offline

 

#2 2017-11-27 09:41:34 pm

DJ Bazzie Wazzie
Member
From:: the Netherlands
Registered: 2004-10-20
Posts: 2727
Website

Re: Application hierarchy - like in the heads-up menu

Joy wrote:

Till now I found no way to access some sort of list with 1St, 2nd, 3rd process and so forth. Some ideas or suggestions?



Simple answer: In AS there is no way.

For other readers who are familiar with C and CoreFoundation:
From LaunchServices.framework (LS) you can get the application list by 'last used'. This is undocumented, which means it is not supported and the symbol can be changed between OS versions which makes it fragile. But to give a complete answer there is a symbol in LS called __LSCopyApplicationArrayInFrontToBackOrder. This C-function will return an array of applications in the same order as cmd+tab. So the only two ways to get this is by either writing an OSAX or Objective-C wrapper class which can be used by AppleScrtipObjC.

You can find a great example here where the returned data is an CFArrayRef type which is an toll-free bridge Objective-C "object". It's a great starter and can be used in either an OSAX of Objective-C wrapper class.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)