Page 1 of 1

help using "sed" in applescript

Posted: Tue Feb 01, 2005 1:28 am
by 37pens
After a couple ours of looking at other's scripts, and googling I've been unable to use sed in one of my applescripts.

here's basically what i need to do:


ugly = "Iím in here. Wouldnít you like to be in here too?"


I need to change the "í" into apostrophes

My problems are:
1) I can't change the value of a variable. (I can sed things in text files)
2) I can't seem to escape the single quote.


Thanks.

Posted: Tue Feb 01, 2005 6:51 am
by BlueRevolution
I have a sub to fix that exact problem in my whedonesquism script. feel free to steal it.

Posted: Tue Feb 01, 2005 6:55 am
by zaudragon
can't you escape ' by using \' ?

I used it in my ü8312-1_££7 script as \"

Posted: Tue Feb 01, 2005 7:13 am
by 37pens
Thanks a lot BlueRev that worked perfectly.


zau - for whatever reason using \ to escape the ' just wouldn't work for me. Thanks though