Re: System Events versus Finder
Re: System Events versus Finder
- Subject: Re: System Events versus Finder
- From: Matt Neuburg <email@hidden>
- Date: Wed, 27 Feb 2008 06:19:26 -0800
- Thread-topic: System Events versus Finder
On or about 2/27/08 5:55 AM, thus spake "KOENIG Yvan"
<email@hidden>:
> Perhaps you may explain if it is normal that
>
> tell application "system events" to make new folder at <someFolder>
> with properties {name:"myNewFolder"} fails when it is described by:
>
> make v : Make a new object. [etc]
I guess my response is that I wouldn't give it any thought at all. The
dictionary gives no evidence as to what kinds of objects System Events is
willing to make (and, of course, you never quite know from the dictionary
what the precise expected syntax of "make" is going to be [p. 350]).
As a programmer, I'm naturally very lazy; since I already know other ways to
make a new folder (e.g. the Finder, mkdir, etc.) I wouldn't even bother
trying to get System Events to do it!
However, it can do it if you just bang away at it and work out (by guessing)
what syntax it expects. For example, this works, as I discovered by guessing
and testing:
tell application "System Events" to make new folder at end of alias
"feathers:Users:mattneub:Desktop:" with properties {name:"newFolder"}
But really, you know, expecting other people to do the guessing and testing
instead of doing it yourself is *really* lazy! m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, http://tinyurl.com/2ouo3b
Take Control of Customizing Leopard, http://tinyurl.com/2t9629
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden