1

Anyway to obtain list of Application that can open a file via Terminal? offered a JavaScript which no longer works on macOS 13.1 Ventura. Has anyone updated this script or have a different one?

#!/bin/bash 
whatOpens() {
    osascript -l JavaScript <<OSA
        ObjC.import('CoreServices');
    ObjC.deepUnwrap(
            $.LSCopyAllRoleHandlersForContentType(
                    &quot;$1&quot;,
                    $.kLSRolesAll
            )
    ).map(x=&gt;Application(x).name())
     .join('\n');

OSA }

whatOpens "$1"

05:50:10 ~/desktop :whatOpens public.text execution error: Error: TypeError: undefined is not a function (near '...).map(x=>Application(x).n...') (-2700) 05:53:31 ~/desktop :

nohillside
  • 100,768

0 Answers0