Someone wrote in [personal profile] maradydd 2008-04-10 05:21 pm (UTC)

HFS vs POSIX

iTunes play command can accept any of the following: iTunes playlist or track reference, HFS path string, file alias or file URL. If you've got a POSIX path, the easiest thing would be to use an NSURL; see -[NSURL fileURLWithPath:].

I don't think there are any commands in iTunes or Finder that absolutely require HFS paths, although they may accept them in some places as a convenience to AppleScript users. There is the odd Carbon app that does force you to use HFS strings for some things; e.g. IIRC, Excel and Illustrator both require their use in 'save' commands due to poor/buggy design. A few older Carbon apps such as Finder may also have problems with file URLs, used to specify files that don't already exist, which may require you to use HFS strings instead if they'll accept them.

As for using path strings vs file objects in general, Apple's Scripting Interface Guidelines do advise developers always to use the latter, thereby avoiding all the HFS vs POSIX hassles to begin with. (Though if you've been around AppleScript for a while you'll already know what scriptable application developers - including Apple - are like for following guidelines.)

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org