409
Stefano Monti
AppleScript e AppleScript Studio, Dischi, CD, DVD e Backup, Terminal e sottosistema BSD, Utility, Tips&Tricks, Easter Eggs
http://faqintosh.com/faq/409.xml - XML della Faq: http://faqintosh.com/faq/409-data.xml
3207 giorni, 3 ore, 11 minuti
Questo allegato alla FAQ è un programma in AppleScript che consente, tramite il comando di shell screencapture, di attivare la funzionalità di cattura immagini durante la riproduzione con DVD Player.
Lo script:
tell application "Finder" to ¬end run
set ListaPNG to name of every file in desktop ¬
whose name ends with ".png"
set Risultato to button returned of (display dialog ¬"Capture or reset counter (" & my Incremento("") & ")..." with title ¬if Risultato is "Reset" then
"DVD screen capture" buttons {"Reset", "Capture"} default button 2 with icon note)
my Incremento(true)end if
return run
set Nome to item 1 of ListaPNG
repeat until ListaPNG does not contain Nomeset Nome to (("dvd_" & my ConvertiContatore(my Incremento(false), 3) & ¬end repeat
".png") as string)
do shell script "screencapture -i ~/Desktop/" & Nome
set Numeri to "0000" & Numeroend ConvertiContatore
set C to length of Numeri
return (characters (C - Q + 1) thru C of Numeri) as string
if Reset = "" thenend Incrementoset Riferimento to open for access file Prefelse if Reset then
tryset N to (read Riferimento) as stringon errorset N to 1end try
close access file Pref
return Ntryelse if not Reset thenset Riferimento to open for access file Pref with write permissionon error Errore
write (1 as string) to Riferimento
close access file Prefclose access file Prefend trytryend ifset Riferimento to open for access file Prefon error Errore
tryset N to (read Riferimento) as stringon errorset N to 1end try
if N = "" then set N to 1
close access file Pref
set Riferimento to open for access file Pref with write permission
write (((N as integer) + 1) as string) to Riferimento
close access file Prefclose access file Prefend try
display dialog Errore
tell application "Finder" to set Esiste to exists item Pref
if not Esiste thenset Riferimento to open for access file Pref with write permissionelse
write (1 as string) to Riferimento
set N to 1
close access file Prefset N to 100end if
return N
Google+ | |
---|---|
|
|