Re: I cannot even successfully have the Finder make a folder on the Desktop!
Re: I cannot even successfully have the Finder make a folder on the Desktop!
- Subject: Re: I cannot even successfully have the Finder make a folder on the Desktop!
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 27 Jul 2004 11:42:32 -0700
On 7/27/04 11:09 AM, "Bill Planey" <email@hidden> wrote:
>
tell application "Finder"
>
make new folder at path to desktop folder) with properties
>
{name:"folderName"}
>
end tell
>
>
>
Gives me this in the Error log:
>
>
tell application "Finder"
>
path to desktop
>
alias "TiBook_HD:Users:bplaney:Desktop:"
>
make new folder at current application with properties
>
{name:"folderName"}
>
"Finder got an error: Can't make a folder."
>
>
>
I am on 10.3.4 and logged in as the admin.
>
>
Any ideas?
Read the dictionaries. The Finder dictionary does not contain a 'path to'
nor 'desktop folder': you can just use 'desktop' which is a property of the
application:
tell application "Finder"
make new folder at desktop with properties {name:"folderName"}
end tell
The Finder will coerce 'desktop folder' to desktop if you insist.
OR you can use 'path to' Standard Addition, which also doesn't know about
'desktop folder' but does have a 'desktop' enumeration. In this case you'd
have to do it _outside_ the Finder tell block: the term 'desktop' will be
interpreted as the targeted application's version when there's a terminology
conflict inside a tell block: the application (Finder) meaning always takes
precedence. Inside a Finder tell block 'desktop' still gets evaluated as a
Finder object and then 'path to' gets an error. So:
set dsktp to (path to desktop)
tell application "Finder"
make new folder at dsktp with properties {name:"folderName1"}
end tell
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.