Una opción sería utilizar AllApplications en un script de shell:
tell application "Finder"
set p to POSIX path of (item 1 of (get selection) as text)
end tell
set l to do shell script "~/bin/AllApplications -path " & quoted form of p & " | sed 's/.*\///g;s/\.app$//g' | sort -f | uniq"
set answer to choose from list (paragraphs of l) without multiple selections allowed
if answer is false then return
set a to item 1 of answer
set p to path to application a
tell application "Finder" to open selection using p
También puede usar System Events para obtener las aplicaciones desde el menú Abrir con:
tell application "System Events" to tell process "Finder"
set l to name of menu items of menu 1 of menu item "Open With" of menu 3 of menu bar 1
end tell
set text item delimiters to linefeed
set l2 to do shell script "grep -vx 'missing value' <<< " & quoted form of (l as text) & " | grep -vx Other… | sed -E 's/ \([^)]*\)$//g;s/ \(default\)$//g;s/\.app$//g' | sort -f | uniq"
set answer to choose from list (paragraphs of l2) without multiple selections allowed
if answer is false then return
set a to item 1 of answer
set p to (path to application a)
tell application "Finder" to open selection using p
Realmente no probé los scripts, pero probablemente estén afectados por rdar: // 9406282: la selección de scripts del Finder puede hacer referencia a un falso valor no correlacionado con la interfaz de usuario .
Preguntas relacionadas en el superusuario: