AppleScript Error: -10000

Examples and stuff

Moderator: Zach

AppleScript Error: -10000

Postby arnau » Thu Jan 28, 2010 1:00 am

Hi all,

I have a nokia n95 8GB and I try to change the profile when I enter the proximity zone when I'm in the office. To do so I check the ip address of the laptop (MacBook Pro running snow leopard) where I run BluePhoneElite 2 (Version 2.2.5 (3286) ), to do so I have created an script. The problem I have is when it is executed, I get the following error:

"AppleScript Error: -10000. A device error occured" (Yes, occured not occurred, it's not a typo :) ).

At the first moment, this script was part of another script (run-isync-profile.applescript from the examples) giving the same problem. Then I split it in two different, but the error remained. The only way I have made it work was introducing debug dialogs, e.g. "display dialog ("current ip: " & internalIP)" and then it worked. So I guess it's a timing problem that I don't know how to solve it without those annoying dialogs. Any ideas?

Thank you very much


-- tell AppleScript where to look for the dictionary when it compiles the script
using terms from application "BluePhoneElite 2"

-- set up a handler for any proximity change event
on proximity change thePhone with event "entered"
run_change_profile()
end proximity change
end using terms from

on run_change_profile()
try
set internalIP to do shell script "ipconfig getifaddr en0"
on error
try
set internalIP to do shell script "ipconfig getifaddr en1"
on error
set internalIP to "not found"
end try
end try

display dialog ("current ip: " & internalIP)

if internalIP = "not found" then
return
else
set officeNetwork to "192.168.10."

if internalIP contains officeNetwork then
tell application "BluePhoneElite 2"
tell device "N95" to set the active ring profile to "Office"
end tell
end if

end if
end run_change_profile
arnau
 
Posts: 1
Joined: Thu Jan 28, 2010 12:46 am

Re: AppleScript Error: -10000

Postby Zach » Thu Feb 18, 2010 1:40 pm

My guess is that you are getting this error because the phone is not connected.

Do you still have this problem if you connect before you set the proximity (connect device "N95")? Or maybe use the "connection change" event instead.
Zach
Developer
 
Posts: 513
Joined: Thu Apr 07, 2005 12:25 pm


Return to AppleScript Resources

Who is online

Users browsing this forum: No registered users and 1 guest