• 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: On the difficulties of "/"" in Applescript with example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On the difficulties of "/"" in Applescript with example


  • Subject: Re: On the difficulties of "/"" in Applescript with example
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 17 Oct 2013 10:37:26 -0500

On Oct 17, 2013, at 9:30 AM, Walter Bushell wrote:

Given the difficulties encountered in merely escaping quotes is it perhaps better to replace them with an arbitrary sequence, for example "!xyzzy!" and change them when it's time to actually use them. What happens with quotes is the slashes disappear in the course of normal use.

I'm having trouble seeing what your result is supposed to be, but I have a suggestion.
-->  Avoid use of POSIX file.  <--
(Sometimes it's necessary when using 'do shell script …'.
But you aren't using that, here.)

You might start with changing the first line

set x to POSIX file "/Users/Walter/Music/\"ur\"file"

to something like this:

set x to alias "OS_X:Users:lutherfuller:Desktop:Switch \"Back\" 2.rtf"
x as text
log the result
return

I used a file on my desktop in this example, you can use your file.
The file name on my desktop has double quotes around the word "Back".
I inserted it into the script with drag & drop.

Changing the text path name of a file using AppleScript string commands should work without error.

Another example:

set x to alias "OS_X:Users:lutherfuller:Desktop:Switch \"Back\" 2.rtf"
tell application "Finder" to set theFolder to container of x
set theFilepath to (theFolder as text) & "Switch \"Back\" 2.rtf"
log theFilepath
set fileAlias to (theFilepath as alias)
log fileAlias

Using \" here is seems not to be a problem.


 _______________________________________________
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: 
 >On the difficulties of "/"" in Applescript with example (From: Walter Bushell <email@hidden>)

  • Prev by Date: On the difficulties of "/"" in Applescript with example
  • Next by Date: Re: AppleScript-Users Digest, Vol 10, Issue 357
  • Previous by thread: On the difficulties of "/"" in Applescript with example
  • Next by thread: Re: On the difficulties of "/"" in Applescript with example
  • Index(es):
    • Date
    • Thread