• 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: What is the quoted form property of a string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the quoted form property of a string?


  • Subject: Re: What is the quoted form property of a string?
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 25 Jan 2002 14:57:55 -0800

On Thursday, January 24, 2002, at 04:22 PM, Bill Hoffman wrote:

And how does one reference or access it in a script?

I note that this now works in the 1.8.2 beta release, but I don't know what
it is. Any help?

The "quoted form" property is intended for use with "do shell script" to get file names with interesting characters (space, *, parens, etc.) past the shell intact. If you've got a string (say s), just say "quoted form of s", and there you go. A typical example would be something like this:

set f to (choose folder)
do shell script "ls -l " & quoted form of POSIX path of f

choose folder returns an alias (stored in f); "POSIX path of f" returns a string (e.g., "/Users/somebody/Random Stuff", and "quoted form of" adds quote marks so the shell treats the string literally. For example, without the quote marks the shell would have interpreted "Random Stuff" as two parameters separated by a space, not one parameter with a space in it.

This is fairly useless on Mac OS 9, of course, because there's no shell to talk to, but it's supported anyway so you can at least look at scripts designed for Mac OS X.


--Chris Nebel
AppleScript Engineering


References: 
 >What is the quoted form property of a string? (From: Bill Hoffman <email@hidden>)

  • Prev by Date: Re: Smile 1.8.4 or 1.8.7 and AppleScript 1.8.2b1 anyone?
  • Next by Date: Re: Weird try block syntax
  • Previous by thread: What is the quoted form property of a string?
  • Next by thread: Script hotsync??
  • Index(es):
    • Date
    • Thread