• 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: HFS Path To POSIX Path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HFS Path To POSIX Path


  • Subject: Re: HFS Path To POSIX Path
  • From: "J. Todd Slack" <email@hidden>
  • Date: Mon, 1 Sep 2008 19:17:05 -0700

HI Alex,

Yes that does work for me in two steps, but I cannot get it to work in one.

Thank You!

-Jason

On Sep 1, 2008, at 6:14 PM, Alex Heinz wrote:

You could try:

set myPath to get the location of the current track
set myPOSIXPath to POSIX path of myPath

(or perhaps combine into one statement, which I think should work.)

Alex

On Sep 1, 2008, at 6:00 PM, J. Todd Slack wrote:

Hi Gregory,

What is the proper way to convert an HFS Path to a POSIX path?

The proper way is to make whatever effort you can to avoid having an HFS path to worry about in the first place. So if you have any control over that end of things, I'd say avoid it. In particular, if you're storing a file reference for any length of time, prefer aliases.

It is an Option is AS can do it.

I do:

tell application "iTunes"
				set myTrack to get the name of the current track
				set myArtist to get the artist of the current track
				set myAlbum to get the album of the current track
				set myPath to get the location of the current track
end tell

'myPath' is an HFS path. I know when using the choose file dialog I can do this:

set selectedFile to POSIX file (choose file)

but I am not sure when I get the information directory from iTunes.

I then take the 'myPath' and pass to Objective-C for working with it.

-Jason


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: HFS Path To POSIX Path (From: Gregory Weston <email@hidden>)
 >Re: HFS Path To POSIX Path (From: "J. Todd Slack" <email@hidden>)
 >Re: HFS Path To POSIX Path (From: Alex Heinz <email@hidden>)

  • Prev by Date: Re: Objective-C and AppleScript
  • Next by Date: Re: basic Core Data scaling question
  • Previous by thread: Re: HFS Path To POSIX Path
  • Next by thread: basic Core Data scaling question
  • Index(es):
    • Date
    • Thread