Hi Folks,
may you can bring some light into the darkness…
In my application I have to check the pincode of the simcard - this will be done by:
set xstr to "at+CPIN?" & return
serialport write xstr to portRef
delay 1
set pin_card to serialport read portRef
display dialog pin_card
delay 1
Now I am checking the result - if the result is “SIM PIN” then there must be a password entered - the Simcard is locked:
if pin_card contains "SIM PIN" then
show window "pin"
repeat
try
if pin_get is false then exit repeat
end try
end repeat
hide window "pin"
end if
I have put a text field “txt_pin” and a button “bt_pin” on my window “pin” - to check wheter the pincode is correct I made the onclick handler
if name of theObject is "bt_pin" then
repeat
try
tell current application
set theAnswer to contents of text field "txt_pin" of window "pin"
set xstr to "at+CPIN= " & theAnswer & return
delay 1
set pin_read to serialport read portRef
delay 1
if pin_read does not contain "ERROR" then
set pin_get to false
exit repeat
end if
end tell
end try
end repeat
end if
The Problem:
I am not able to press bt_pin and not able to delete a previous entered code in txt_msg… I know I just can give you small informations, but maybe I made an error in this construct…
Thanks for your help…
Stefan