Una opción sería el uso de 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 utilizar los Eventos del Sistema 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
Yo en realidad no prueba las secuencias de comandos, pero son probablemente afectados por rdar://9406282: Buscador de secuencias de comandos de selección puede referirse a los falsos valor no se correlacionó con la interfaz de usuario.
Las preguntas relacionadas con el Super Usuario: