Cut everything except between "Quotes"

Hi Folks,

Using Scripting Additions I am able to connect do my modem and send ATCommands to the device!

http://mysite.verizon.net/vzenuoqe/MacSoft.html

this script works pretty fine - alltough I kindly ask you to help me solving this:


serialport list


shows the connected devices


set portRef to serialport open "/dev/cu.HUAWEIMobile-Modem"
if portRef is equal to -1 then
display dialog "Could not connect to port"
else
delay 1
set xstr to "at+cops?" & return
serialport write xstr to portRef
delay 1
set show to serialport read portRef for 35 --shows 35 digits
display dialog show
serialport close portRef
end if


The Output is now:

at+cops?
+cops: 0,0,“T-Mobile A”,

Question:

How can I cut out everything in this variable xstr exept “T-Mobile A”

Thanks for your help!

Best Regards,

Stefan

By ‘Output’ do you mean how ‘show’ presents in your dialog?

Hi Adam,

sorry - Yes this is correct!

Thanks for your help and your time!

Best regards,

Stefan


set show to "at+cops?
+cops: 0,0,\"T-Mobile A\"," -- quotes escaped because they are inside quotes
-- this is the part that does it (the line above is to give me something to work with)
set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to "\"" -- again, quotes escaped
set Q to text item 2 of show
set AppleScript's text item delimiters to tid
display dialog Q

Hi Adam,

this works PERFECT!

thousand times “Thanks a lot”

Best Regards,

Stefan