Re: POSIX file wierdness
Re: POSIX file wierdness
- Subject: Re: POSIX file wierdness
- From: Bill Cheeseman <email@hidden>
- Date: Sat, 07 May 2005 07:54:39 -0400
on 2005-05-06 5:22 PM, Alastair Rankine at email@hidden wrote:
> OK so you're basically saying that "foo" isn't a "slash-delimited path"
> as required by the POSIX file extension, and so all bets are off?
That's my understanding. But I'm no expert in the area of POSIX paths, so
some research is in order. There's a tech note, or at least a thread in the
list archives, about this, with some explanations from Apple engineers. It's
worth a search.
> FYI I get exactly the same results with a path that has slashes in it:
>
> class of POSIX file "/Users/alastair"
>
> changes to the following when compiled:
>
> class of file "al2book:Users:alastair"
Yes, I've noticed this. I believe it's a little compile-time optimization at
work. AppleScript has always "converted" synonyms to canonical form at
compile time, although I'm not sure this is exactly what's happening here.
> This also executes successfully, but If I make a trivial change to this
> script it will produce the NSCannotCreateScriptCommand error.
Perhaps this is because the edited path doesn't correspond to an actual file
on disk? Try changing the file name in the Finder first, then editing your
script. Does it work now? Alias references have always had this compile-time
restriction, and perhaps it has been extended to this syntax.
> From my perspective this is extremely broken behaviour. Not only is the
> AppleScript compiler semantically changing my source code, it's actually
> breaking it.
If my suggestions above pan out, then it isn't broken. The semantic changes
are a designed-in feature with a long pedigree, and so is the alias
reference restriction. It's just a matter of learning the quirks of any
language.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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