This has probably been asked billions of times, but a quick search of the boards didn’t give me an answer.
on an “open” event in a window I want this to happen:
tell application "Finder" to make new folder at desktop with properties {name:"testing"}
But I want it to check and see if the folder already exists and if it does exist I don’t want it to do anything.
I know this is basic, but I can’t seem to figure it out.
Thanks in advance.
How about :
try
tell application “Finder” to make new folder at desktop with properties {name:“testing”}
on error
display dialog “Folder already exists!”
end try
–this script was automatically tagged for
–color coded syntax by Script to Markup Code
–written by Jonathan Nathan
I knew that on error was part of what I needed, but I had forgotten that I needed to put try and end try. :oops:
Thanks tugboat!
What can I have it do (or not do) on error so the user of my app doesn’t see anything?
Thanks.
How about:
try
tell application “Finder” to make new folder at desktop with properties {name:“testing”}
end try
-