Re: Path of a folder represented in AppleScript path style
Re: Path of a folder represented in AppleScript path style
- Subject: Re: Path of a folder represented in AppleScript path style
- From: Matt Neuburg <email@hidden>
- Date: Fri, 15 Jul 2005 10:48:02 -0700
On Tue, 12 Jul 2005 21:42:42 -0700, Ron Ballesteros <email@hidden> said:
>Hi List,
>
>I'm working on a little app that needs to write to a file a bunch of
>folder paths. I can get the folder paths in the usual POSIX style
>path as returned by -subpathsAtPath:(NSString *)path but I need to
>write the paths in the AppleScript style of
>"MacHD:Users:ronmb:Desktop:DataFolder:"
>
>I was trying to search the archives but was having a hard time
>figuring out what exactly the search terms would be.
>
>Is there something in Cocoa that will allow me to provide it a POSIX
>path and return to me the AppleScript style path?
Well, there's something in AppleScript that will do it (and NSAppleScript is
in Cocoa, so I guess the answer is Yes).
set s to "/Users/mattneub/Desktop/somefile"
set f to POSIX file s
return f as string
-- "feathers:Users:mattneub:Desktop:somefile"
Beware, however, of encoding issues, which are absolutely horrendous in
AppleScript. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden