Seite 2 von 2

Verfasst: So 19. Feb 2012, 16:08
von bnilantha
FJ hat geschrieben:
save the file, then open the file %appdata%\MyPhoneExplorer\general.ini and add this lines:

Code: Alles auswählen

[EventHandlers] 
OnIncomingMessage=<path to script> number="%number" text="%text"
i tried with this on IE it was working fine. But on google chrome and firefox split text by space. i cant get full text

Verfasst: Di 21. Feb 2012, 23:42
von FJ
Why you are using a browser to accept this command ? If it does not work on chrome then you have to replace the spaces probably by a script with %20

Verfasst: Fr 24. Feb 2012, 17:29
von bnilantha
FJ hat geschrieben:Why you are using a browser to accept this command ? If it does not work on chrome then you have to replace the spaces probably by a script with %20
i want to save sms to mysql database once recieved sms also have to some function. i cant replace it on your command line. how can i do that?

Verfasst: Fr 24. Feb 2012, 19:25
von rationalboss
FJ hat geschrieben:MyPhoneExplorer has already interfaces to detect incoming messages and to send messages. Create a *.vbs-File with this content:

Code: Alles auswählen

Dim i, text, number, tmp, outtext

'First we filter out the commandlinearguments. We get the sender of the SMS and the text throught commandline from MPE
For i = 0 to WScript.Arguments.Count - 1
  tmp = WScript.Arguments.Item(i)
  If Instr(1, LCase(tmp), "number=") = 1 Then
    number = Mid(tmp,8)
  ElseIf Instr(1, LCase(tmp), "text=") = 1 Then
    text = Mid(tmp,6)
  End If
Next

'MPE does send the Number if possible also with the name (like "Name [0123456789]"), we have to cut this of.
If Instr(1,number,"[") <> 0 Then
  number = Mid(number, InstrRev(number,"[") + 1)
  If Instr(1, number, "]") <> 0 Then
    number = Left(number, Instr(1, number, "]") - 1)
  End If
End If

'Msgbox "Text=" & text & vbNewLine & "Number=" & number  'This line is for debugging, it shows the parsed variables

If IsNumeric(number) = True Then 

' you can also set a numberfilter and/or textfilter like: If number = "1234567" And InStr(1,text,"question") <> 0 Then
' here you could do anything. An example: Another program writes some value (lets say the weather) into a local file
' your script checks if the messagetext contained "weather" and if yes then the script reads the wheater-textfile and
' tells the sender of the message how the weather will be. Or maybe it answers with the count of unread emails when the
' text contained "emails"

   outtext = "Automated response (" & text & "):%nThis is a test-feedback"  'here the returned text is set, %n represents a line break

   RunMPE "action=sendmessage flags=noerrmsg savetosent=1 number=" & number & " text=" & Chr(34) & outtext & Chr(34)
End If


Function RunMPE(Arguments) 
  set shell = CreateObject("WScript.Shell") 
  shell.run "myphoneexplorer " & Arguments ,3 
End Function
save the file, then open the file %appdata%\MyPhoneExplorer\general.ini and add this lines:

Code: Alles auswählen

[EventHandlers] 
OnIncomingMessage=<path to script> number="%number" text="%text"
how can the received message be deleted? :)

Verfasst: Di 28. Feb 2012, 11:50
von bnilantha
??

Verfasst: Di 6. Mär 2012, 22:32
von FJ
Do it with Visual Basic Scripts

Please do not misunderstood, i am helpfully to everybody. But i do not understand why you are dealing with pho, mysql,... without knowing even the basics. Its not the target that i will build scripts for every tiny thing for you. Learn scripting, there are many stuff about this in the web and i wrote already some scripts for you so you have examples