• 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: File Path Delimeters for Shell Scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Path Delimeters for Shell Scripts


  • Subject: Re: File Path Delimeters for Shell Scripts
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 27 Nov 2003 12:50:36 -0800

On 11/27/03 12:28 PM, "Rick Gordon" <email@hidden> wrote:

> How should I most easily go about changing the colon delimiters in a file path
> to slash delimiters for use in a "do shell script" command?

By using the 'POSIX path' property. For 'do shell script' you're normally
going to want 'quoted form' of file paths as well, to do spaces correctly.
It inserts single quotes so you don't need to do wither AppleScript
quote-escapes nor Unix space-escapes. It will work on both aliases and text
(Unicode preferably) file paths.

set posixPath to quoted form of POSIX path of alias "disk:folder:file"

do shell script ("whatever " & posixPath)

--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >File Path Delimeters for Shell Scripts (From: Rick Gordon <email@hidden>)

  • Prev by Date: Re: File Path Delimeters for Shell Scripts
  • Next by Date: Color Labels in Panther
  • Previous by thread: Re: File Path Delimeters for Shell Scripts
  • Next by thread: Re: deleting text
  • Index(es):
    • Date
    • Thread