Re: Path To commands
Re: Path To commands
- Subject: Re: Path To commands
- From: Gary Lists <email@hidden>
- Date: Tue, 07 Jan 2003 14:33:34 -0500
On or about 1/7/03 12:33 AM, Philippe Gruchet wrote:
>
Should we consider this tell block [no break] below concerned by the
>
"respect to the Startup Disk special folder" ?
>
>
tell application "Finder" to make at (path to "docs" as alias) with
>
properties {name:{"foo"}, file type:"ttro", file creator:"ttxt"} new
>
file
>
>
What do you think about this line?
I think it's beautiful. ;)
I am certainly not the best to ask for in-depth knowledge of the Finder's
limitations...or AS either. However, Philippe, if you are not familiar with
a brilliant English 'saying', here it is: "If it isn't broke don't fix it."
If you feel uncertain about portability, then set some variable to 'path to
"docs" as alias' then include that in the tell line.
set x to path to "docs" as alias
tell application "Finder" to make at x ...
Nearly as "compact" and that _seems_ to be what the cautionary note
suggested, as I understood it.
In the very recent (related) thread "Moving files from desktop to User
folders" I asked Paul B. to offer some more insight into this very issue. I
have a tendency to "just do what he says", as that seems to work in my
favor. Here is what he did say:
I wrote:
>
> Paul,
>
>
>
> Can you offer any further information about this issue, as well as any other
>
> comments about being inside a 'tell' vs. outside?
Paul B. answered:
>
1) In OS 8/9, 'path to desktop' inside a Finder tell block would actually
>
get you the path to the startup disk - or maybe it was the other way around,
>
I've forgotten now.
>
>
2) Other 'path to' statements in the Finder would occasionally be wonky -
>
I'm sorry i can no longer remember specific details.
I wrote:
>
> Your comment here made me think about some errors that I can't seem to
>
> explain, and although I've tried moving statements, I haven't isolated every
>
> instance where I've set some reference inside when maybe it should have been
>
> out.
Paul B. answered:
>
3) Running any Standard Additions inside an application tell should be
>
avoided when not necessary (sometimes it's very necessary to use them in
>
tell blocks, especially 'display dialog') to avoid unnecessary terminology
>
conflicts. In particular 'file'. 'file' is used by AppleScript, Standard
>
Additions (e.g. 'open for access'), notoriously the Finder, and also
>
notoriously Outlook Express and Entourage, to mean very different things.
>
The application's terminology always rules, which prevents you using the
>
same term for an osax or AppleScript meaning.
From what he says, I am now doing all of my Path To setting (and most other
stuff too) outside any tell block, then referencing it inside the tell
block. It does make some logical sense to me, even without any errors.
HTH, Philippe
--
Gary
Incoming replies are auto-deleted.
Please post directly to the list or newsgroup.
Really need direct? Rot me at:
email@hidden
Lbhe fhowrpg zhfg ortva "abgwhax:" (ab dhbgrf)
Avpr gb zrrg lbh! Qba'g fcnz zr.
_______________________________________________
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.