Re: Path To blessed items (OSX and OS9): Odd or Normal?
Re: Path To blessed items (OSX and OS9): Odd or Normal?
- Subject: Re: Path To blessed items (OSX and OS9): Odd or Normal?
- From: Gary Lists <email@hidden>
- Date: Sat, 21 Jun 2003 04:19:42 -0400
On or about 6/20/03 8:15 PM, Nigel Garvey wrote:
>
Gary Lists wrote on Thu, 19 Jun 2003 20:11:19 -0400:
>
>
> path to "xxxx" -- where xxxx is an OS-valid 4-char folder code
>
>
>
> If the folder equivalent did not already exist, then a folder is created at
>
> its default location. If a user does not have 'Apple Extras' or 'Users' and
>
> then they see them sitting there when the script finishes, it is a bit
>
> disconcerting ... and more than rude! ;)
>
>
I suppose the logic is that 'path to' returns (by default) an alias - and
>
you can't have an alias to a non-existent item. That then raises the
>
question: is a script that asks for the path to a standard, defined item
>
more likely to want to use that item or to be told simply that it doesn't
>
exist? Creating the item automatically seems to be an intelligent - if
>
not immediately expected - choice.
Agreed. I do get (and think wrote) that it does make sense that you can't
have a 'path to' something that doesn't exist. Seems to me, also, that you
should not create something that doesn't exist unless asked to do so.
'path to' does not logically imply 'and also create without asking'.
>
> "" & (path to "usrs" as string)
>
>
[?]
Yes, I know. Sad, isn't it? :) Some kind of lame attempt to coerce matter
into anti-matter. Super String Theory? [1]
>
>
> We are not saying this is not the proper (um...well known?) behavior, though
>
> it does seem unexpected. We do, however, need to deal with it in our
>
> respective scripts.
>
>
I haven't thought this through for every possible 'path to' parameter,
>
but many 'blessed items' that may have been deleted would normally be in
>
known locations relative to other 'blessed items' that are bound to
>
exist, such as within the System folder or on the startup disk. It would
>
be a bit complicated with OS X's domains, but you might be able to work
>
out a cheat based on this. What is it your scripts are supposed to do?
>
>
NG
Other than creating lots of folders that users don't want -- they present a
list of the known 4-character codes that may be used with 'path to', along
with their default location on the users system, for review or even for
putting the proper 'path to "usrs"' (for example) on your clipboard. Kind
of a scripting aid to easily retrieve the 4-char code for the "Internet
Search Sites" folder or whichever.
The real task is going to be finding a way to determine whether the item was
previously present or not.
(It just struck me that maybe the way is time-based. Ticks. Just before
the command, then get the creation time of the item just returned, then
delete if it didn't exist prior to the tick line.)
Thanks for your input, Nigel.
--
Gary
[1]
http://superstringtheory.com/
The Elegant Universe: Superstrings, Hidden Dimensions, and the Quest for the
Ultimate Theory -- by Brian Greene
An Introduction to Quantum Field Theory -- by Michael E. Peskin, Daniel V.
Schroeder
_______________________________________________
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.