• 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: Best practices
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best practices


  • Subject: Re: Best practices
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 17 Feb 2011 18:56:55 -0600

On Feb 17, 2011, at 11:00 PM, Shane Stanley wrote:
I don't understand this. Are you saying you can't use regular expressionswith HFS paths?
______________________________________________________________________

It's mighty easy to manipulate a path via regular expressions be it HFS or Posix path.

Personally I still prefer aliases, because that's what a grew up on (in Applescript).  It's very easy to convert an alias to a string, manipulate it and convert back to an alias.

# Requires the Satimage.osax

set hFldr to "" & (path to home folder)

set usrFldr to change "[^:]+:$" into "" in hFldr ¬
case sensitive false ¬
with regexp

set usrFldr to alias usrFldr

However - the more I use the Terminal the more I like Posix paths.

It is only sensible considering Mac OS X's Unix underpinnings that Applescript would gradually move to adopt the Posix path specifier in every circumstance.

--
Chris
 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Best practices (From: Shane Stanley <email@hidden>)
 >Re: Best practices (From: Emmanuel LEVY <email@hidden>)

  • Prev by Date: Re: Best practices
  • Next by Date: Re: Applescript Studio and Snow Leopard?
  • Previous by thread: Re: Best practices
  • Next by thread: URL in Firefox
  • Index(es):
    • Date
    • Thread