Attivating the display dialog window
Attivating the display dialog window
- Subject: Attivating the display dialog window
- From: Miky P <email@hidden>
- Date: Thu, 13 Jul 2006 01:39:40 -0700 (PDT)
Ok!
My script seems to work now. The "delay" solved the problem
because without delay some fotos opens OK, other do not
open at all.
I use step to identify the place when an error occurs. I
know I should use on error's parametres but I don't know
for now how to use them.
Another question I have: how can I position the display
window?
Here is the source:
try
set step to "Lista foto"
tell application "Finder"
set lista_foto to files in folder Ã
"Macintosh HD:Users:miky:FOTO:temp" where name ends with
".jpg"
end tell
set step to "Repeat"
repeat with foto in lista_foto
-- Apri la foto con Preview
set step to "Apri foto"
tell application "Finder"
open foto
-- Richiesta all'utente il nuovo nome della foto
set step to "Il nome della foto"
set Nome_Foto to name of foto
activate
set step to "Display dialog"
set finestra_domanda to display dialog "Nome corrente: "
& Nome_Foto Ã
default answer Ã
"" buttons {"OK", "Non cambiare", "Annulla"} default
button 1 Ã
with title "Inserire il nome della foto:"
-- Se l'utente ha specificato il nuovo nome, rinomino il
file
set step to "Button"
if the button returned of the finestra_domanda = "OK"
then
set step to "Il nuovo nome"
set nuovo_nome to text returned of the finestra_domanda
-- Solo se l'utente ha inserito un nome cambio il nome
della foto
set step to "Rename"
if nuovo_nome is not equal to "" then
set name of foto to nuovo_nome & ".jpg"
end if
end if
end tell
tell application "Preview" to quit
delay 1
end repeat
on error msg_err number no_err
if no_err = -128 then -- Operazione annullata
tell application "Preview" to quit
else
display dialog step & ": " & msg_err & "(" & no_err & ")"
as string
tell application "Preview" to quit
end if
end try
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden