ho uno applescript, non ricordo da dove proviene, che in pratica raccoglie le icone dei programmi.
Questo script ha un limite, in relazione a quanto devo fare io, che apre le immagini da Anteprima.
Vorrei semplicemente salvare i percorsi icns delle applicazioni in un semplice documento.txt
Potreste aiutarmi?
Grazie
set myApps to (do shell script "find /Applications -name \"*.app\" -print")
set listApp to every paragraph of myApps as list
repeat with x in listApp
set var to (POSIX file x) as alias
set Inf to (var as string) & "Contents:Info.plist"
try
set Inf to Inf as alias
set myApp to POSIX path of Inf
set n to (do shell script "cat \"" & myApp & "\" | tr \"\\r\" \"\\n\" | grep --binary-files=text -n CFBundleIconFile | cut -f 1 -d :") + 1
set stringaIcona to characters 2 thru -1 of (paragraph n of (read Inf)) as string
set nomeIcona to do shell script "echo \"" & stringaIcona & "\" | cut -f 2 -d \">\" | cut -f 1 -d \"<\""
if nomeIcona does not end with ".icns" then
set nomeIcona to nomeIcona & ".icns"
end if
set pathIcona to ((var as string) & "Contents:Resources:" & nomeIcona) as alias
========= IN PRATICA NON VOGLIO QUESTO =========
tell application "Preview" to open pathIcona
===============================================
===== MA UNA COSA DEL TIPO =========
save pathicona to "path.txt" e relativo percorso ad una data cartella
==================================
on error x number y
do shell script "echo \"Errore: " & y & "\" > /dev/console"
end try
end repeat
Messaggio modificato da Signor D, 16 giugno 2012 - 20:47
etichette












