Re: On the difficulties of "/"" in Applescript with example
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