• 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: "~" vs. "POSIX file"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "~" vs. "POSIX file"


  • Subject: Re: "~" vs. "POSIX file"
  • From: Philip Aker <email@hidden>
  • Date: Tue, 24 Oct 2006 20:38:21 -0700

On 2006-10-24, at 13:10:28, Christopher Nebel wrote:

Anyway, my indirect point was that AppleScript ought to be able to do tilde expansion on a POSIX file cast.

POSIX file "~/Desktop/some.txt"
--> file ":~:Desktop:some.txt"

I'd point out that other scripting languages, even ones that grew up on Unix, do not support that, and they don't support it because "~" isn't actually part of POSIX path syntax.

But Chris,

I'd didn't say it was part of POSIX path syntax (as in POSIX standard). What I said was: "…AppleScript ought to be able to do tilde expansion on a POSIX file cast.".

Meaning that the aim of the facility shouldn't put the onus on the user to figure out whether or not that "~/xxx", which is a widely used convention in OS X, is eligible. Rather, it should make a reasonable attempt to convert whatever into a usable 'file'.

Even better would be for AppleScript to up the ante a bit on the Tcl approach with something like:

	native path of "~/xxx/some.txt" using YYY conventions

where YYY would currently be one of POSIX, HFS, DOS, URL, or (something I haven't thought of right now). If YYY is omitted, it would mean whatever convention is valid for the platform AppleScript is currently running on. So:


native path of "~/xxx/some.txt" using URL conventions --> "file://localhost/Users/me/xxx/some.txt"


native path of "~/xxx/some.txt" --> "/Users/me/xxx/some.txt"


native path of "~/xxx/some.txt" using HFS conventions --> "~:xxx:some.txt"


Philip Aker email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >How can I open attachment in Mail ? (From: Victor Frenklakh <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: kai <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: Philip Aker <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: kai <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: Philip Aker <email@hidden>)
 >"~" vs. "POSIX file" (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: "~" vs. "POSIX file"
  • Next by Date: Re: "~" vs. "POSIX file"
  • Previous by thread: Re: "~" vs. "POSIX file"
  • Next by thread: Re: How can I open attachment in Mail ?
  • Index(es):
    • Date
    • Thread