Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Path Delimeters for Shell Scripts



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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.