Re: path names separators
Re: path names separators
- Subject: Re: path names separators
- From: "Scott Babcock" <email@hidden>
- Date: Mon, 19 Dec 2005 16:29:36 -0800
- Thread-topic: path names separators
FileMaker is returning a POSIX path and you want an HFS path or an
alias. Here's what you do:
First, go out and buy Matt Neuburg's "AppleScript: The Definitive Guide"
Next, look at the "File Coercions" section in Chapter 14.
Seriously, though, here's the code you want. (Assume the posixPath
variable already contains the result from FileMaker):
set posixFile to POSIX file posixPath --
set colonPath to posixFile as Unicode text
set theAlias to posixFile as alias
If all you need is the path to the desktop folder, use this:
set desktopAlias to (path to desktop folder)
set desktopPath to (desktopAlias as Unicode text)
Date: Sun, 18 Dec 2005 21:15:36 +0000
From: has <email@hidden>
Subject: Re: path names separators
To: email@hidden
Message-ID: <a05200f01bfcb7f998bba@[82.2.139.98]>
Content-Type: text/plain; charset="us-ascii"
Bob Cuilla wrote:
>I am using some native AS inside of Filemaker Pro 8. When I use the FM
>Get Desktop Path function it returns a path that uses "/"
>separators for files/folders etc. AS doesn't seem to like these
>separators. If I replace the "/" with ":" AS handles them just fine.
>
>Can I assume from this the AS doesn't like the "/" in path names?
HFS paths use colon separators. POSIX paths use slashes. (There are
other differences as well.) AS supports both, but in different ways and
places.
BTW, it'd help if you gave an example of what you're talking about.
(ISTR FMP likes to produce these bogus 'file:...' strings that look a
bit like file URLs but aren't, just to make things extra confusing.)
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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