Re: Creating a folder on the desktop
Re: Creating a folder on the desktop
- Subject: Re: Creating a folder on the desktop
- From: Christopher Nebel <email@hidden>
- Date: Tue, 6 Sep 2005 12:12:08 -0700
On Sep 6, 2005, at 11:36 AM, patrick machielse wrote:
Op 6-sep-2005, om 19:04 heeft Andrew Oliver het volgende geschreven:
On 9/6/05 7:35 AM, "patrick machielse" <email@hidden> wrote:
I can't get this to work
tell application "System Events"
make new folder at desktop folder
end tell
The Finder is generally responsible for all file/folder handling.
System Events handles just that - _system_ events. Creating a
directory is
not a system function, hence the need to use the Finder (or some
other app
that manages the file system.
Well, some would say that creating folders is a system function par
excellence...
And in fact, we happen to agree. Not that you should avoid the
Finder, but you shouldn't *have* to use it.
More importantly, the System Events library explicitly mentions the
'make' command, with semantics almost identical to those of the
Finders 'make' command, which to me is like a promise that it
should work. Also, I _can_ move folders using "System Events".
Just because a command and an object are in the same dictionary is
not a guarantee that the object responds to the command. Tiger gives
dictionary writers a way to specify this information, but most
writers haven't caught up yet.
That said, System Events can make folders, but you have to know the
magic incantation to get around the design bug in Cocoa Scripting.
You can't make something "at" a container in a Cocoa application, you
have to make it the end of the container. For instance, this works:
tell app "System Events" to make new folder at end of desktop folder
Yes, we know it's lame.
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
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