• 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: [Q] How to get a containing folder of a given file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] How to get a containing folder of a given file?


  • Subject: Re: [Q] How to get a containing folder of a given file?
  • From: Philip Aker <email@hidden>
  • Date: Tue, 19 Sep 2006 23:50:14 -0700

On 2006-09-19, at 22:05:27, JongAm Park wrote:

I am trying to get the path of a containing folder of a file.

[...]

P.S. AppleScript seems to be more difficult than the Objective-C & Cocoa... :(

The AppleScript implementation which comes closest to Cocoa is in AppleScript studio. It's possible to call Cocoa class methods from AppleScript there. For general purpose scripting, including disk, folder, and file stuff, the closest implementation is in System Events.


tell application "System Events"
    POSIX path of container of (path to desktop)
end tell

but if you just need the user's folder it's:

    path to home folder

Philip Aker
email@hidden


_______________________________________________ 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
References: 
 >[Q] How to get a containing folder of a given file? (From: JongAm Park <email@hidden>)

  • Prev by Date: Re: Hey LIST OWNER, please unsubscribe Monte Babington
  • Next by Date: Re: [Q] How to get a containing folder of a given file?
  • Previous by thread: Re: [Q] How to get a containing folder of a given file?
  • Next by thread: Re: [Q] How to get a containing folder of a given file?
  • Index(es):
    • Date
    • Thread