propertyTempo : "60" -- tempo necessario prima di dare forfait, aumenta questo valore se ottieni un errore di timeout propertyOK : " OK " propertyAnnulla : " Annulla " propertyDettagli : " Dettagli "
tellapplication "Finder" try setCartellatoselection setSCartellato (Cartellaasstring) ifCartella = {} or (countofCartella) > 1thenerror onerror errorreturn & "Selezionare una cartella prima di attivare questo script." & return endtry setTipoCartellatokindoffirstfolderofstartup disk ifkindof (aliasSCartella) isTipoCartellathen withtimeoutofTemposeconds try setNumeroTotaletocounteveryiteminentire contentsofaliasSCartella setNumeroCartelletocounteveryfolderinaliasSCartella setNumerotocountitemsinaliasSCartella ifNumero = 1then seteto "elemento" else seteto "elementi" endif ifNumeroCartelle = 1then setpto "cartella" else setpto "cartelle" endif ifNumeroCartelle is greater than or equal to 1then setMessaggioto "La cartella selezionata contiene " & (Numeroasstring) & "" & e & ", di cui " & (NumeroCartelleasstring) & "" & p & "." & return & return & "Gli elementi contenuti nella cartella " & (nameofaliasSCartella) & " e nelle incluse subcartelle, in totale sono " & (NumeroTotaleasstring) & "." setPulsantito {Dettagli, OK} else setMessaggioto "La cartella selezionata contiene " & (Numeroasstring) & "" & e & "." setPulsantitoOK endif ifbutton returnedofmyDialogo(Messaggio, Pulsanti, OK, 1) isequal toDettaglithen setNumeroAppto0 setNumeroDocto0 setNumeroFldrto0 setOratotimeof (current date) setContatoreto1 setElementitoeveryiteminentire contentsofaliasSCartella repeatwithElementoinElementi ifclassofElemento = application filethen setNumeroApptoNumeroApp + 1 elseifclassofElemento = folderthen setNumeroFldrtoNumeroFldr + 1 else setNumeroDoctoNumeroDoc + 1 endif if (timeof (current date)) - (Tempo / 2) > Orathen ignoringapplication responses myDialogo("Elaborazione in corso..." & return & return & "Attendere..." & return & return & "Elemento " & (Contatoreasstring) & " di " & ((countofitemsinElementi) asstring), "", 1, 1) endignoring setOratotimeof (current date) endif setContatoretoContatore + 1 endrepeat myDialogo("Contenuti in " & (nameofaliasSCartella) & ":" & return & return & ¬ " Cartelle: " & return & "" & (NumeroFldrasstring) & return & return & ¬ " Documenti: " & return & "" & (NumeroDocasstring) & return & return & ¬ " Applicazioni: " & return & "" & (NumeroAppasstring) & return, OK, OK, 1) endif onerrorTnumberN setTempoTto (Tempo / 60) asinteger ifTempoT = 1then setmto "minuto" else setmto "minuti" endif myDialogo((Nasstring) & " - L'elemento selezionato contiene troppi elementi, richiederebbe più di " & (TempoTasstring) & "" & m & " per completare l'elaborazione.", Annulla, Annulla, 0) endtry endtimeout else myDialogo("L'elemento selezionato non è una cartella", Annulla, Annulla, 0) endif endtell