Thursday, July 19, 2018

#1 2015-10-16 04:27:53 pm

Registered: 2015-10-16
Posts: 2

How to list all handler applications for URL scheme?

For example this objective-c code lists all applications that can open https, can i do the same using applescript?

#import <Foundation/Foundation.h>
#import <ApplicationServices/ApplicationServices.h>

int main (int argc, const char * argv[])
                CFStringRef https = CFSTR("https");
                CFArrayRef availableBrowsers = LSCopyAllHandlersForURLScheme(https);
                CFIndex availableBrowserCount = CFArrayGetCount(availableBrowsers);
                NSUInteger i;
        for (i = 0; i < availableBrowserCount; i++) {
            NSString *browserBundleIdentifier = (NSString*)CFArrayGetValueAtIndex(availableBrowsers, i);
            printf(" %-45.45s", [browserBundleIdentifier UTF8String]);



#2 2015-10-16 04:51:04 pm

Shane Stanley
From:: Australia
Registered: 2002-12-07
Posts: 5409

Re: How to list all handler applications for URL scheme?

No, you can't do it directly from AppleScript. You'd need to add an Objective-C class with code similar to that you posted, and call it from your script.

Shane Stanley <>



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)