Re: Creating a folder on the desktop
Re: Creating a folder on the desktop
- Subject: Re: Creating a folder on the desktop
- From: "John C. Welch" <email@hidden>
- Date: Tue, 06 Sep 2005 20:52:15 -0500
- Thread-topic: Creating a folder on the desktop
Title: Re: Creating a folder on the desktop
On 9/6/05 13:36, "patrick machielse" <email@hidden> wrote:
> Why is it that Finder doesn't understand "~/Desktop"? Finder should
> 'get with the program', the forward slash has been with us for more
> than 4 years now. If anything, the use of ':' should be deprecated,
> that should have been in the coffin with OS 9 :-)
Nonsense. That's part of HFS+ semantics, and alias semantics too, and far more useful for referencing volumes by name while avoiding the entire /Volumes/ requirement.
As well, the Finder doesn't really notice the difference between the desktop and some folder somewhere else. To the finder, they're both folders.
System Events isn't really the place for a lot of this either, since while it knows about the Desktop folder, it knows it as a thing that lives in the User Domain Object.
The place that I would go for paths to things is standard additions, which handles pretty much every path semantic correctly, and lets you get a path however you like with ease:
set thePath to POSIX path of (path to desktop) works quite well, no application reference needed.
Standard additions “path to” command is the best of both worlds in this case, and will make your life much simpler.
If you look at making a folder, there’s a certain logic the way both do it. The Finder doesn’t really care WHERE you make the folder as long as you have permission to do so. However, look at the properties list for a folder in the Finder. It’s quite large, and contains all the properties of a folder you’d care about were you dealing with it in the Finder. Things like permissions, contents, URL, comment, container separate from container windows, etc. Note also that any property that can be normally changed by the user can also be changed by the Finder dictionary.
System Events really doesn’t care that much about folders beyond the basics. It’s a folder, it’s been created, SE is pretty much not caring. This is noted by the fact that out of 18 properties, only 3 are not read only: the name, the mod date, and the visible status. SE cares about the POSIX path because it has to, whereas the Finder doesn’t, because again, the Finder doesn’t care where the folder is, as long as it’s in a valid location. The System DOES care, hence System Events knowing about the different domains.
To Standard additions, everything that involves the property of a file or folder is read only, and so you can’t even change the name of a folder with SA. This is as it should be, since you have System Events and the Finder to change folder properties if you need to, so why reinvent that wheel.
I’m not sure I agree with the Finder and System Events both dealing with folders from subtley different angles, but I have yet to figure out a markedly better way, since both have an interest in this.
In general, if I need basic information about a folder, I use Standard Additions. If I need a lot of information about a folder as a standalone thing, I use the Finder. If I need information about a folder as it relates to the OS, I use System Events.
>
> Just last night I watched the 2003 WWDC AS presentation from Sal
> Soghoian, in which he talked about the 5 ways to reference files in
> AS, and today, in 2005, I'm still running into walls.
It’s like anything...you have to learn what the system is trying to tell you, instead of making it work the way you think it should.
--
Yes, you got grounded for having the very same porn stash that turned up in Dad’s closet six months later. You still can’t bring it up. The cosmic scales of justice will never tip in your favor on this one, trust me. Bide your time patiently, and one day you might get the chance for revenge. Like, by unplugging his dialysis machine. Or something.
_______________________________________________
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