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

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


  • Subject: [Q] How to get a containing folder of a given file?
  • From: JongAm Park <email@hidden>
  • Date: Tue, 19 Sep 2006 22:05:27 -0700

Hello.
I am trying to get the path of a containing folder of a file.
By looking up the dictionary and some web sites, I found out that there
was a "containder" property of a file.
However this presents an error message.

tell application "Finder"
set my_file_path to path to desktop folder
-- get container of my_file_path as text
set directory_path to (container of my_file_path)
end tell

I tried "container of file my_file_path" also. I tried converting them
to text or string also. But it displays message like
"Can't make <<class ctnr>> of alias "..........." into type string.

Can anyone please tell me how to solve this problem?

Thank you.

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: [Q] How to get a containing folder of a given file?
      • From: Yvan KOENIG <email@hidden>
    • Re: [Q] How to get a containing folder of a given file?
      • From: Philip Aker <email@hidden>
    • Re: [Q] How to get a containing folder of a given file?
      • From: david <email@hidden>
    • Re: [Q] How to get a containing folder of a given file?
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: PhotoShop CS2 Export for Web Syntax
  • Next by Date: Re: [Q] How to get a containing folder of a given file?
  • Previous by thread: Re: PhotoShop CS2 Export for Web Syntax
  • Next by thread: Re: [Q] How to get a containing folder of a given file?
  • Index(es):
    • Date
    • Thread