Risposte:
Un'opzione sarebbe quella di utilizzare AllApplications in uno script 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
È inoltre possibile utilizzare 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
In realtà non ho testato gli script, ma sono probabilmente interessati da rdar: // 9406282: la selezione degli script del Finder può fare riferimento a un valore fasullo non correlato con l'interfaccia utente .
Domande correlate a Super User: