View Full Version : Scripting a text message for London Congestion Charge
XDA2-owner
30th June 2004, 12:29 AM
Hi there,
Is it possible (or could any kind developper!) to script a text message that would always have the same text.
Basically to pay the London Congestion Charge (£5 for driving into Central London), one needs to send a text message to the number 81099 containing the last four digits of their credit card.
As the message is always the same, I thought it might be easy to script such a message to make it easy to pay the charge.
Thanks!
collins199820
30th June 2004, 12:39 AM
isn't that easy? set up your pre set messages as the words and numbers u need so then u create a new text and click my text chose the one u want and send it!
XDA2-owner
30th June 2004, 12:41 AM
Hi,
Thanks for your reply. I see what you mean, but that is still several clicks more than I have in mind. With a script/batch file, it would literally be a one button (through a shortcut) click which could even be assigned to a hardware button. Lazy ... maybe! I guess it all really depends on whether the function to send a text message can be accessed from the command line.
collins199820
30th June 2004, 12:54 AM
no kidding ur lazy!
bob190cm
30th June 2004, 01:42 AM
You can write smssender.html which will include a javascript, that will redirect you to:
mailto:123456789 body="Send me a taxi!" - I'm not sure about the syntax... :D
Everytime you execute this webpage, you will only have to confirm SMS sending and close IE (I don't know if window-terminating scripts work in PocketIE) :idea:
collins199820
30th June 2004, 01:49 AM
(!)
sheran_g
30th June 2004, 07:22 AM
I don't know if you're willing to pay for it, but there is a utility called Cell Profiler found here (http://www.handango.com/PlatformProductDetail.jsp?siteId=1&jid=29BXE3F4B662XCB369B5B776D818FF8C&platformId=2&productType=2&catalog=0§ionId=0&productId=120193)
You can pre-define an SMS to be sent to a particular number when you drive through a particular point.
Download the trial and see if it fits in with your requirements.
k_kirk
30th June 2004, 07:53 AM
You can use the scripting utility called nscriptm to automate your screen taps etc. Give it a go. Its fairly simple and there is a good sample that shows you how to work with screen taps.
XDA2-owner
30th June 2004, 08:50 AM
Thanks for your replies. I will try each and see what works best for me.
Thanks again!
moose2
30th June 2004, 03:02 PM
Hi there,
Is it possible (or could any kind developper!) to script a text message that would always have the same text.
Basically to pay the London Congestion Charge (£5 for driving into Central London), one needs to send a text message to the number 81099 containing the last four digits of their credit card.
As the message is always the same, I thought it might be easy to script such a message to make it easy to pay the charge.
Thanks!
I wonder if I understand you correctly. In my SMS messaging on the XDAII I have something called My Text as a menychoise. The predefined messages in there can be added/amended in the Edit menu...You could do it easily there...?
XDA2-owner
30th June 2004, 03:47 PM
Hi,
Yeah - someone mentioned that earlier. What I was really looking for though was a literally one-button way to pay my congestion charge - basically a shortcut to a batch-file/script that creates the SMS, enters the text and addresses it correctly.
Does anyone know if the mailto: command that you can use to create an e-mail would work for an SMS? If so, that would be fine as within the mailto: command you can specify the recipient (81099 in this case) and the text (credit card digits).
Thanks for all the responses.
bob190cm
30th June 2004, 05:17 PM
1. PPCs don't make any difference between e-mails and short messages - you have same dialog, same options and same mailto: command...
2. JavaScript in HTML page is probably the fastest way to perform actions you need (if you dont want to write it in C++ of coz!)
3. If I'm not too drunk today I'll have probably posted an example of such page by tomorrow - I finished with school today, so I have something to celebrate! 8)
XDA2-owner
30th June 2004, 06:12 PM
Would be great to see a javascript sample if you could be bothered/sober enough to put one together.
Thanks very much indeed.
bob190cm
30th June 2004, 07:43 PM
So, that's what it looks like:
<html><body>
<script language="JavaScript">
window.location="mailto:81099?body=Here's my creditcard number!"
</script>
</body></html>
mailto: - where
body: - what
You can also add subject: (don't forget to divide it with "?" :!: )
It looks like Pocket IE does not support close() function. Can anyone confirm? Any way, even if you will have to close IE manually, executing this file (possibly from Today screen) and pressing SEND is still faster than going to New>SMS>MyText>choose>enter number>confirm... 8)
XDA2-owner
30th June 2004, 10:58 PM
That worked just great! Thank you so much.
I used the PHM Pocket PC PowerToys's TrayLaunch program to put a shortcut to the .htm file onto the bottom bar of the Today screen.
I still need to press the Send button (is there a way to automate that?) and close IE but it's still MUCH quicker than doing it through a manual SMS.
Thanks again for all comments and help.
Robrecht
21st April 2005, 01:09 PM
Hi there,
I'm a total newbie (NOT a programmer at all), just a Qtek 9090 addict. I 've been looking for something similar to your request: I wanted a way to go straight to the "compose text message" window from the today screen or a hardware button. I finally found a way to do this (maybe not the best way, but I can't find a site that lists all the possible parameters for tmail.exe).
If you're still looking for a better way to automatically launch your message, try this:
Copy the "Messaging" shortcut from Windows/Start Menu and put the copy somewhere you can work on it. Rename it to something like "London Congestion".
If you have Resco file explorer on your device, select your new shortcut and view its properties. On the second tab ("shortcut"), you should see the line "\Windows\tmail.exe". Change it to this:
"\Windows\tmail.exe" -service "text" -to "81099" -body "your credit card number"
Then tap "ok".
Move your new shortcut to Windows/Start Menu/Programs. Now you should be able to access it with your Today screen launcher or Button launcher.
If you don't have Resco file explorer, copy your shortcut to your desktop and open it with Notepad. You'll see something like 43#"\Windows\tmail.exe"; just leave the number at the front, make the adjustments I described and save the file. Then put it in Windows/Start Menu/Programs on your device.
I tested this and it worked for me, so I hope it does for you too!
To simply go to the "compose" window from a shortcut, I use this line:
"\Windows\tmail.exe" -service "text" -to ""
Robrecht.
XDA2-owner
22nd April 2005, 04:34 AM
Thanks a lot Robrecht,
I was actually going to re-open this issue because I have a Blueangel now - and I don't know if it's because it is WM2003 Second Edition or not, but the javascript that was written for me in the above post no longer works, so I needed a new method.
A very timely reply and I will try it over the weekend.
Thanks a lot,
Jimmy
cruisin-thru
22nd April 2005, 05:31 AM
I think you should add "I hope it chokes you bunch of rip off bastards" We pay road tax, we pay huge tax on fuel, we sit for hours in jams and they want money :?:
Robrecht
23rd April 2005, 01:50 AM
Well, XDA2-owner, you're very welcome!!!
I have a Blue Angel too and it works for me, except....... I discovered a flaw.
I thought the
-service "text"
parameter made sure the automatically created message was always a text (SMS) message, but instead it turns out that the format of the new message (SMS, e-mail, MMS...) changes according to the last viewed folder in Pocket Outlook. So if you were checking your e-mail account just before you use my shortcut, it wil create an e-mail instead of a text message.
This sucks! And I was so happy I'd been able to help someone!
Does anyone know a way to make sure the new message is always a text message?
XDA2-owner
10th May 2005, 12:47 AM
Hi again,
This issue was one I was also having with the Javascript - I got used to the fact that if I was using the e-mail part of Messaging, I would switch it back to SMS before closing it.
One issue I am having though - and it might just be to do with my setup - is that when I run the shortcut from Start-->Programs-->Congestion, it works fine. When I try and launch it from my Today screen though, using BatteryPackPro, it doesn't seem to create the text message, and just stays on the Today screen.
Any ideas?
Thanks again for your help and ideas.
cruisin-thru
10th May 2005, 02:56 AM
How does the last 4 digits of your credit card identify you and your vehicle, is any other info sent.
Robrecht
11th May 2005, 12:12 PM
Gee, you're right, it doesn't work with Battery Pack Pro. I guess BPP doesn't support the extra arguments... Damn.
Since you'll be in your car when you need to send this message, you could map the shortcut to a button so you can open it with one hand. It does work that way. This is what I did (I use the simpler version I described, that just opens a blank new message): I set up VITO Button Mapper so that pressing the mail button brings up Pocket Outlook as usual, but holding it down longer creates a new message.
Woops, wait, I just tried something - Battery Pack Pro does offer a way to include extra arguments! You should choose "custom program link", somewhere in the upper part of the program list in BPP's Program Bar setup. Then put \Windows\tmail.exe in the first box, and -service "text" -to "81099" -body "your credit card number" in the second. That way you won't even need the shortcut I told you to create.......
Hope this works for you. The only downside is it shows up in the Today-screen Program bar as a standard 'folder' icon, rather than a pretty envelope....
Good luck, drive safely :wink:
Robrecht
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.