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
![[MIRA SOFTWARE]](/global/menu/_home.gif)
![[SOFTWARE]](/global/menu/software.gif)
![[FORUMS]](/global/menu/forums.gif)
![[MY ACCOUNT]](/global/menu/account.gif)