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

"~" vs. "POSIX file"


  • Subject: "~" vs. "POSIX file"
  • From: Christopher Nebel <email@hidden>
  • Date: Tue, 24 Oct 2006 13:10:28 -0700

On Oct 24, 2006, at 12:35 AM, Philip Aker 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. For instance, in Perl you'd say


	"$ENV{'HOME'}/Desktop/some.text"

The equivalent in AppleScript would be

	POSIX file ((system attribute "HOME") & "/Desktop/some.txt")


--Chris Nebel AppleScript Engineering

_______________________________________________
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
  • Follow-Ups:
    • Re: "~" vs. "POSIX file"
      • From: Philip Aker <email@hidden>
    • Re: "~" vs. "POSIX file"
      • From: "Mark J. Reed" <email@hidden>
    • Re: "~" vs. "POSIX file"
      • From: email@hidden (Randal L. Schwartz)
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>)

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