• 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
"Quoted form" puzzlement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Quoted form" puzzlement


  • Subject: "Quoted form" puzzlement
  • From: Rob Lewis <email@hidden>
  • Date: Wed, 10 Nov 2010 10:18:59 -0800

When I enter this in script editor: 

set x to "/a/b/c/Jack's trip.jpg"
quoted form of x

I get this: 

"'/a/b/c/Jack'\\''s trip.jpg'"

Disregarding the main enclosing double quotes (which always appear when the editor displays a string value), and parsing the backslashes, this should translate to this, right?

'/a/b/c/Jack'\"s trip.jpg'

Am I missing something? I can't make any sense out of this, and I doubt it would work as a valid POSIX path. And how did that double quote get stuck in the middle of the string? 

Now try the same code in a "Run AppleScript" block in Automator: 

on run {input, parameters}


set x to "/a/b/c/Jack's trip.jpg"
return quoted form of x
end run

Guess what gets returned. This: 

'/a/b/c/Jack'\''s trip.jpg'

which is the same as my "decoded" form of Script Editor's result, but still doesn't make any sense that I can see. 

It seems to me the correct encoding should be this: 

'/a/b/c/Jack\'s trip.jpg'

Am I wrong? What does it all mean? 
 _______________________________________________
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

  • Follow-Ups:
    • Re: "Quoted form" puzzlement
      • From: Skeeve <email@hidden>
    • Re: "Quoted form" puzzlement
      • From: Laine Lee <email@hidden>
  • Prev by Date: Scripting Ovolab's Phlink
  • Next by Date: Scripting Adobe PhotoShop CS5
  • Previous by thread: Re: Scripting Ovolab Phlink
  • Next by thread: Re: "Quoted form" puzzlement
  • Index(es):
    • Date
    • Thread