Re: Finder acting up
Re: Finder acting up
- Subject: Re: Finder acting up
- From: Autocat <email@hidden>
- Date: Wed, 22 Dec 2004 09:24:11 +0100
Thanks very much for your reply.
I'm having a bunch of problem scripting the Finder (this is under
10.3.6 & 10.3.7)
duplicate theFile to theDestinationFolder with replacing
Just doesn't duplicate if there's already a file with the same name
in the destination folder. Same problem is I use move instead of
duplicate (the destination folder is on a local hard disk)
Did you use "with replacing"?
Yep.
Also, I spent a great deal of time trying to determine if a folder
exists, and create one if it doesn't. I tried the various "folder
exists" syntaxes to no avail.
This works for me:
tell application "Finder"
if not (exists folder "test folder" of startup disk) then
make new folder at startup disk with properties {name:"test folder"}
else
display dialog "That folder already exists."
end if
end tell
if not (exists folder "test folder" of startup disk) then
does not compile, ScriptEditor hilights the opening quote of "test
folder" and displays a Expected “, ” but found “ error message
and if I try to run
tell application "Finder"
make new folder at startup disk with properties {name:"test folder"}
end tell
I get a runtime error: "Finder got an error: Can't make a folder"
Are you running OS X 10.3.6/7 ?
It has been brought to my attention that maybe I should try sending the
events to "System Events" instead of "Finder". It fixed the "exists
folder" problem
if (exists folder (gPathToRootPDFFolder)) then -- works
end if
But I had no luck creating a new folder.
make new folder at theFolder with properties {displayed name:"Test"}
Just returns
System Events got an error: NSArgumentsWrongScriptError
This is unreal. I know that AppleScripting can be very tedious, but I'd
never have thought I'd be spending hours trying to determine if a
folder exists and create it if not.
/Laurent
_______________________________________________
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