• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finding and shelling out to a sh script in the same directory as the AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding and shelling out to a sh script in the same directory as the AppleScript


  • Subject: Re: Finding and shelling out to a sh script in the same directory as the AppleScript
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 5 Feb 2009 08:25:09 -0700

On Feb 5, 2009, at 8:02 AM, Mark J. Reed wrote:

So given an alias, you can't find out what folder it's in without the
Finder?

set text item delimiters to {":"}
set resourcesFolder to (text items 1 through -2 of (path to me as text)) as
text


Okay, "can't" was too strong a word. :)  I'm just surprised that
aliases don't have a container property...

This is strange, actually.

Compare the following two scripts:

tell application "Finder"
set foo to item 1 of (get the selection)
end tell
properties of foo

tell application "Finder"
set foo to item 1 of (get the selection) as alias
end tell
properties of foo

The first returns the properties (one of which is container), but the latter returns an error.

Using the first, although all the properties are returned, if you try to get any particular property, you can get only those properties whose class is defined outside the Finder.  E.g., you can get the class, name, displayed name, index, size, creation date, etc., but you can't get the container, owner, etc.

-- Michelle

-- 
I've noticed lately that the paranoid fear of computers becoming intelligent and taking over the world has almost entirely disappeared from the common culture.  Near as I can tell, this coincides with the release of MS-DOS.
-- Larry DeLuca

 _______________________________________________
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

References: 
 >Finding and shelling out to a sh script in the same directory as the AppleScript (From: elliottcable <email@hidden>)
 >Re: Finding and shelling out to a sh script in the same directory as the AppleScript (From: Luther Fuller <email@hidden>)
 >Re: Finding and shelling out to a sh script in the same directory as the AppleScript (From: "Mark J. Reed" <email@hidden>)
 >Re: Finding and shelling out to a sh script in the same directory as the AppleScript (From: Michelle Steiner <email@hidden>)
 >Re: Finding and shelling out to a sh script in the same directory as the AppleScript (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Finding and shelling out to a sh script in the same directory as the AppleScript
  • Next by Date: Re: Finding and shelling out to a sh script in the same directory as the AppleScript
  • Previous by thread: Re: Finding and shelling out to a sh script in the same directory as the AppleScript
  • Next by thread: Re: Finding and shelling out to a sh script in the same directory as the AppleScript
  • Index(es):
    • Date
    • Thread