Un'opzione potrebbe essere quella di utilizzare AllApplications in uno script di 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
Potresti anche utilizzare gli eventi di sistema per ottenere le applicazioni dal menu Apri 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
Non ho veramente testato gli script, ma sono probabilmente interessati da rdar: // 9406282: La selezione dello script del Finder può riferirsi a false valore non correlato con l'interfaccia utente .
Domande correlate su Super User: