PDA

View Full Version : AppleScript - Escape not working?




idonotliketostu
Oct 15, 2009, 06:08 PM
How do I get rid of the backslash in the results?



mysterytramp
Oct 15, 2009, 08:56 PM
In the Result window, you can't. It's how AppleScript handles quotes internally. But the slashes won't appear in dialog boxes or in text output.

mt

idonotliketostu
Oct 15, 2009, 10:03 PM
I though the results area is the text output area? which text output area are you referring to.

mysterytramp
Oct 16, 2009, 06:43 AM
I though the results area is the text output area? which text output area are you referring to.

Files. You can run this test:

display dialog "Please input string (please use quotes):" default answer ""
set textOutput to text returned of result
set quotedText to textOutput -- check Events window and you'll see your string with slashes and quotes
display dialog "Here's what you input, without slashes:" & return & quotedText
display dialog "Now we'll save the string to a disk"
set docAlias to path to documents folder
set newFileName to (choose file name with prompt "Please enter a file name" default name "quote test" default location docAlias)
set newFileNameString to newFileName as string
set outPutfile to open for access file newFileNameString with write permission
write quotedText to outPutfile starting at eof
close access outPutfile
display dialog "Now please check the quotes in your file."


mt