Variable in Quotes

Hi Folks,

it is Sunday and new troubles…

set pegel to "AT+CGDCONT=1,\"IP\".\"gprsinternet"\"" & return

will show pegel as "at+cgdcont=1,“IP”,“gprsinternet”

but if I am sending this variable it will be sent with the backslashes - so far so good - that
means that I have to eliminate the \ - any suggestions?

Thanks for your help!


Your example and result don’t have balanced quotes. What do you really want?

Hi Adam,

the variable should be "at+cdgcont=1,“IP”,“gprsinternet”

How can I set the variable with the quotes in it?

best regards,


Hi stefanl, Sorry I just realised I did not reply to a your previous post about screen. I did do some tests after to see if I could get it talking to my Mobile phones modem vie BT. this I did with lots of issues, but my tests and reply got stalled by me getting side tracked.

I have not really followed all of you changes to your project but get the impression you have changed Tacked.

The bit of script you posted was missing a \

Also AFAIK the escapes "" if sent to a shell from applescript should not get sent. They are the only for Applescripts sake.


set pegel to do shell script "echo \"AT+CGDCONT=1,\"IP\".\"gprsinternet\"\""

If not in your case (depending on the rest of your script) then maybe the echo part is what you need to set the Variable

** realised you you lose the quotes, thought I had an answer… still checking…

ok this seems to work

set pegel to "\"AT+CGDCONT=1," & "\"IP\"" & "," & "\"gprsinternet\""
display dialog pegel

Hi Mark,

thanks for your time and help! When displaying it, it works as I expected - but when I am writing it to the modem it still
has the Backslashes… :rolleyes:

I am working on it and will post the results :slight_smile:

Best Regards and Thanks,