Li'l Help with my if, then, else statement?
Li'l Help with my if, then, else statement?
- Subject: Li'l Help with my if, then, else statement?
- From: "T.J. Mahaffey" <email@hidden>
- Date: Fri, 02 Mar 2001 04:02:44 -0600
Can someone tell me why this isn't following the if, then statement
properly?
The setup works beautifully, but if the "Utilities" folder IS present, it
still tries to make on and errors out due to there being a folder of the
same name already.
Guidance is very much appreciated.
Be well and happy scripting!
T.J. Mahaffey
tell application "Finder"
if folder "Utilities" exists then
try
duplicate file "Network Assistant Preferences" of folder "Remote
Control Setup" of disk "MacLab NetAssist Setup" to folder "Preferences" of
folder "System Folder" of startup disk
duplicate file "Network Assistant Startup" of folder "Remote
Control Setup" of disk "MacLab NetAssist Setup" to folder "Extensions" of
folder "System Folder" of startup disk
duplicate folder "Network Assistant Folder" of folder "Remote
Control Setup" of disk "MacLab NetAssist Setup" to folder "Utilities" of
startup disk
display dialog "MacLab Network Assistant Setup is complete."
buttons {"Cancel", "Cool!"} default button 2 with icon 1
on error
display dialog "There was an error. The installer script will
now quit."
end try
else
display dialog "There's no Utilities folder. I'll make one for you."
make folder in startup disk with properties {name:"Utilities"}
try
duplicate file "Network Assistant Preferences" of folder "Remote
Control Setup" of disk "MacLab NetAssist Setup" to folder "Preferences" of
folder "System Folder" of startup disk
duplicate file "Network Assistant Startup" of folder "Remote
Control Setup" of disk "MacLab NetAssist Setup" to folder "Extensions" of
folder "System Folder" of startup disk
duplicate folder "Network Assistant Folder" of folder "Remote
Control Setup" of disk "MacLab NetAssist Setup" to folder "Utilities" of
startup disk
display dialog "MacLab Network Assistant Setup is complete."
buttons {"Cancel", "Cool!"} default button 2 with icon 1
on error
display dialog "There was an error. The installer script will
now quit."
end try
end if
end tell