Re: Newbie and first questions about old versions
Re: Newbie and first questions about old versions
- Subject: Re: Newbie and first questions about old versions
- From: Ricardo Montiel <email@hidden>
- Date: Tue, 12 Jun 2001 16:11:39 -0300
on 11 Jun 2001 23:52:47 +0100, "Carlos (Madrid)" at <email@hidden>
wrote:
>
> I started writing small routines in Applescript 1.3.7 (OS 8.6) and they work
>
> but when moving these scripts (as applications) to an OS 8.5.1 loaded
>
> PowerPC 860 they do not.
>
> (...)
Hola Carlos,
As the code you posted won't compile on my machine (at least it lacks an
"else"), I rewrote it as follows:
display dialog "Se borraran TODOS los archivos de las carpetas IQ" buttons
{"SI", "NO", "Preguntar"}
set the botonpulsado to the button returned of the result
if the botonpulsado is "SI" then
tell application "Finder"
tell folder "IRIS Color "
tell folder "IQ Folders"
delete every item of folder "Add To Queue "
delete every item of folder "Hot "
delete every item of folder "Output "
delete every item of folder "Print to Disk "
delete every item of folder "Spool "
end tell
end tell
end tell
else
if the botonpulsado is "NO" then
display dialog "No se ha borrado nada"
else
display dialog "PREGUNTA A C.F."
end if
end if
And it works fine in my Mac OS 8.5.1, i.e., deletes every item of the
mentioned folders when button "SI" was pushed, and only when that condition
is true.
As an aside, it'd be faster to directly delete all the folders and
afterwards recreate the needed structure; and, in the same approach, if that
five folders are _ALL_ the folders contained in folder "IQ Folders", then
simple delete the container folder. To recreate the folder structure of your
example, and to run/test the script, I used this (watch the wrapped lines):
set xFolderList to {"Add To Queue ", "Hot ", "Output ", "Print to Disk
", "Spool "}
tell application "Finder"
set xFolder to make folder with properties {name:"IRIS Color "}
set xFolder to make folder with properties {name:"IQ Folders"} at
xFolder
repeat with myFolder in xFolderList
make folder with properties {name:myFolder} at xFolder
end repeat
end tell
HTH
Saludos,
-- Ricardo Montiel
Buenos Aires, Argentina
PS: Please CC me, as I am in digest mode.