Re: Finding and shelling out to a sh script in the same
Re: Finding and shelling out to a sh script in the same
- Subject: Re: Finding and shelling out to a sh script in the same
- From: "Stockly, Ed" <email@hidden>
- Date: Thu, 05 Feb 2009 11:24:07 -0800
- Thread-topic: Finding and shelling out to a sh script in the same
>> It's just the fact that such antics are necessary for so straightforward an
operation which seems strange to me.
Tell application "Finder" to get container of myAlias
That's not really an antic, that's what AppleScript was born to do.
>>> But I have different underlying assumptions there since everything in POSIX
is designed around the idea that files are identified by plain text strings, and
there's no sort of structured object representation analogous to the AS "alias"
on which to hang this sort of behavior.
Score one for AppleScript? Alias is a vestige from Mac OS 7 -9 which used
the same alias manager that tracks aliases in the user interface and was
part of the system, not the Finder. One of its advantages is that if a file
moves or its name changes the alias manager can still resolve the reference.
Since it's a system object designed for another purpose, which didn't
include scripting or a need to work with the container (which the Finder
could do) the object doesn't have a container property.
As this thread shows it's fairly easy to derive an alias container
(including the method below):
set myFile to POSIX path of anAliasFile
set AppleScript's text item delimiters to {"/"}
set fileContainer to text items 1 thru -2 of anAliasFile as text
ES
_______________________________________________
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