Jump to content

AutoSmartphone scripting program now available!


Recommended Posts

Guest maxh2003
Posted (edited)

Since I found out about AutoHotKey - an open-source scripting program for PC that lets you automate virtually anything - I've literally used it every day, for all sorts of purposes. For instance, every night it downloads The Guardian, page by page, as PDFs, then runs commands that concatenate them into a full paper :-D

It strikes me that there's no equivalent (that I can think of) on Smartphone. Obviously there are fewer things to automate on Smartphone, but it could still start and kill apps, send keystrokes to and read text from windows and so on. Plus, if such a thing allowed simple looping, if statements, message boxes and so on, it could be a really useful way to put together a quick program if you need one.

Anyone have any views on this one? Is it worth doing? Anyone see any obvious pitfalls? :D

:edit: no overlap with SmartCommander intended; this is a standalone concept to process text scripts on Smartphone.

Edited by maxh2003
Guest ThatTree
Posted

This is a great idea; I'd love to see more options for general-purpose scripting and scheduling on the Smartphone platform.

xBar 2.5 has introduced some macro capabilities in its Task Scheduler function.

Posted

i think i know what you mean, + i think its a great idea!

Posted

sounds like a great idea. Would allow people less familliar with programming languages to automate tasks on their phone :D

Guest maxh2003
Posted

Early beta version now available from http://www.gamesforsmartphones.com ! :-D

Make sure you read the documentation before using it - you could do nasty things to your phone with this.

Obviously it's pretty simple at the moment - no looping, ifs, or variables, but it *does* allow you to download an arbitrary file to your phone from the net! 8)

The sample downloads the latest UK weather map into your My Documents folder. Possibly useable with that plugin that displays pictures on your homescreen?

Post feedback, bugs, suggestions etc. here...

Enjoy...!

Max

Guest chucky.egg
Posted (edited)

Downloaded this last night and am about to start playing

Can I suggest some more features for when you've got some time:

* String manipulation: LEFT, RIGHT, MID, INSTR, LEN etc

* Date and Time: DATE, MONTH, YEAR, HOUR, MINUTE, SECOND (let people compile their own formats)

So, for example, if I want to download the days weather map for Kent from the BBC (which is here: http://www.bbc.co.uk/weather/maps/sestf060...024symsxxxx.jpg )

I can say:

Dim MyDate, MyMonth, MyYear

If Len(DATE) = 1 then

   MyDate = "0" & DATE

Else

   MyDate = DATE

End if

If Len(MONTH) = 1 then 

   MyMonth = "0" & MONTH

Else

   MyMonth = MONTH

End if

MyYear = Right(YEAR, 2)

URLString = "http://www.bbc.co.uk/weather/maps/sestf"

URLString = URLString & MyDate & MyMonth & MyYear

URLString = URLString & "1200t024symsxxxx.jpg"

URLDownload, URLString, Storage\My Documents,

Edited by chucky.egg
Guest chucky.egg
Posted

What about a timer function too?

I suppose we can schedule stuff with xBar, but I've never needed to before - time to read the manual maybe!

  • 3 weeks later...
Guest AllanHvass
Posted

Asked a question about a macro utility on SmartPhone on a different thread here: http://www.modaco.com/index.php?showtopic=...&st=0&p=553529& , and someone pointed me at AutoSmartPhone.

Got two problems to proceed:

1) Can't get File Explorer to make an association between .shk files and AutoSmartPhone, and thus can't get the macros to actually RUN. Kind of a show stopper :lol: Any ideas?

2) Need a full list of the key codes on a SmartPhone, to be able to script key presses.

Guest maxh2003
Posted
Asked a question about a macro utility on SmartPhone on a different thread here: http://www.modaco.com/index.php?showtopic=...&st=0&p=553529& , and someone pointed me at AutoSmartPhone.

Got two problems to proceed:

1) Can't get File Explorer to make an association between .shk files and AutoSmartPhone, and thus can't get the macros to actually RUN. Kind of a show stopper  :lol:  Any ideas?

2) Need a full list of the key codes on a SmartPhone, to be able to script key presses.

<{POST_SNAPBACK}>

1) - are you only having problems creating a *permanent* association, or can you not get it to run even once? And, are you using www.binarys.com 's File Explorer?

2) These values are in hexadecimal so you'll need to convert them to decimal - you can do that using the windows calculator, in scentific mode.

From the help files for eVC++ 4, example VK_SHIFT is 10 in hex = 16 in decimal:

Symbolic constant Hexadecimal value Mouse or keyboard equivalent

VK_LBUTTON 01 Left mouse button

VK_RBUTTON 02 Right mouse button

VK_CANCEL 03 Control-break processing

VK_MBUTTON 04 Middle mouse button on a three-button mouse

— 05–07 Undefined

VK_BACK 08 BACKSPACE key

VK_TAB 09 TAB key

— 0A–0B Undefined

VK_CLEAR 0C CLEAR key

VK_RETURN 0D ENTER key

— 0E–0F Undefined

VK_SHIFT 10 SHIFT key

VK_CONTROL 11 CTRL key

VK_MENU 12 ALT key

VK_PAUSE 13 PAUSE key

VK_CAPITAL 14 CAPS LOCK key

— 15–19 Reserved for Kanji systems

— 1A Undefined

VK_ESCAPE 1B ESC key

— 1C–1F Reserved for Kanji systems

VK_SPACE 20 SPACEBAR

VK_PRIOR 21 PAGE UP key

VK_NEXT 22 PAGE DOWN key

VK_END 23 END key

VK_HOME 24 HOME key

VK_LEFT 25 LEFT ARROW key

VK_UP 26 UP ARROW key

VK_RIGHT 27 RIGHT ARROW key

VK_DOWN 28 DOWN ARROW key

VK_SELECT 29 SELECT key

— 2A Platform developer specific

VK_EXECUTE 2B EXECUTE key

VK_SNAPSHOT 2C PRINT SCREEN key

VK_INSERT 2D INS key

VK_DELETE 2E DEL key

VK_HELP 2F HELP key

— 30 0 key

— 31 1 key

— 32 2 key

— 33 3 key

— 34 4 key

— 35 5 key

— 36 6 key

— 37 7 key

— 38 8 key

— 39 9 key

— 3A–40 Undefined

— 41 A key

— 42 B key

— 43 C key

— 44 D key

— 45 E key

— 46 F key

— 47 G key

— 48 H key

— 49 I key

— 4A J key

— 4B K key

— 4C L key

— 4D M key

— 4E N key

— 4F O key

— 50 P key

— 51 Q key

— 52 R key

— 53 S key

— 54 T key

— 55 U key

— 56 V key

— 57 W key

— 58 X key

— 59 Y key

— 5A Z key

VK_LWIN 5B Left Windows key on a Microsoft Natural® keyboard

VK_RWIN 5C Right Windows key on a Microsoft Natural keyboard

VK_APPS 5D Applications key on a Microsoft Natural keyboard

5E–5F Undefined

VK_NUMPAD0 60 Numeric keypad 0 key

VK_NUMPAD1 61 Numeric keypad 1 key

VK_NUMPAD2 62 Numeric keypad 2 key

VK_NUMPAD3 63 Numeric keypad 3 key

VK_NUMPAD4 64 Numeric keypad 4 key

VK_NUMPAD5 65 Numeric keypad 5 key

VK_NUMPAD6 66 Numeric keypad 6 key

VK_NUMPAD7 67 Numeric keypad 7 key

VK_NUMPAD8 68 Numeric keypad 8 key

VK_NUMPAD9 69 Numeric keypad 9 key

VK_MULTIPLY 6A Multiply key

VK_ADD 6B Add key

VK_SEPARATOR 6C Separator key

VK_SUBTRACT 6D Subtract key

VK_DECIMAL 6E Decimal key

VK_DIVIDE 6F Divide key

VK_F1 70 F1 key

VK_F2 71 F2 key

VK_F3 72 F3 key

VK_F4 73 F4 key

VK_F5 74 F5 key

VK_F6 75 F6 key

VK_F7 76 F7 key

VK_F8 77 F8 key

VK_F9 78 F9 key

VK_F10 79 F10 key

VK_F11 7A F11 key

VK_F12 7B F12 key

VK_F13 7C F13 key

VK_F14 7D F14 key

VK_F15 7E F15 key

VK_F16 7F F16 key

VK_F17 80H F17 key

VK_F18 81H F18 key

VK_F19 82H F19 key

VK_F20 83H F20 key

VK_F21 84H F21 key

VK_F22 85H F22 key

VK_F23 86H F23 key

VK_F24 87H F24 key

88–8F Unassigned

VK_NUMLOCK 90 NUM LOCK key

VK_SCROLL 91 SCROLL LOCK key

VK_LSHIFT 0xA0 Left SHIFT

VK_RSHIFT 0xA1 Right SHIFT

VK_LCONTROL 0xA2 Left CTRL

VK_RONTROL 0xA3 Right CTRL

VK_LMENU 0xA4 Left ALT

VK_RMENU 0xA5 Right ALT

BA-C0 Platform developer specific; reserved

C1-DA Unassigned

DB-E2 Platform developer specific; reserved

E3 – E4 Platform developer specific

E5 Unassigned

E6 Platform developer specific

E7-E8 Unassigned

E9-F5 Platform developer specific

VK_ATTN F6 ATTN key

VK_CRSEL F7 CRSEL key

VK_EXSEL F8 EXSEL key

VK_EREOF F9 Erase EOF key

VK_PLAY FA PLAY key

VK_ZOOM FB ZOOM key

VK_NONAME FC Reserved for future use

VK_PA1 FD PA1 key

VK_OEM_CLEAR FE CLEAR key

Guest AllanHvass
Posted

Wow - that was quick :-)

Thanks for the key codes. Didn't realize from the description in scripting.txt that it was just the regular ASCII codes for normal characters. Most of the special keys on the SmartPhone was in scripting.txt, though not volume up / down, record button and power button. But the scripting I need to do now don't use those anyway.

Regarding mapping .shk files. I use QTek 8060 built-in "File Manager", which looks suspiciously like "File Explorer" that I have used on an earlier phone. In this program, when you try to run a file with unknown extension, it asks you to create an assocation to an application. I then go through the UI to link .shk files with autosmartphone (which I have run once already to accept this unsigned app), but the association doesn't "stick". I.e. on next attempt to run a script, I still get the error of "no association". In other words, I've not been able to run a script even once.

Obviously, the association is somewhere in the registry. If anyone knows the location, I can just stick the association in there manually using a registry editor. Otherwise, I may have to try to install "File Explorer" instead?

Thanks already,

Allan Hvass

Guest maxh2003
Posted
Wow - that was quick :-)

Right place at the right time :(

I reckon you might well have more luck with binarys.com 's smart explorer - it worked for me :lol:

TBH it's a good program to have knocking around anyway - I recommend their task manager too :D

Purely out of interest, what sort of thing are you scripting? Just interested to know how it's being used - I *will* get round to writing a new version just as soon as I work out how I'm going to handle variables... :-s

Guest AllanHvass
Posted

Thanks - Smart Explorer was able to create the association correctly. Now, I can run .shk files, also from my built-in File Explorer.

My goal with this: I will soon have both a BT car kit and headset to use in the car. The car kit is for default use, both to listen to my voice mails, having quick talks when there's not too much external noise, and especially for using my Mapopolis car navigation program on the SmartPhone. But I still need the headset occasionally, when I want to have a clear communication while driving e.g. on the highway at higher speed, or other situations where there's more external noise (e.g. heavy rain, heavy traffic, etc.).

Now, the SmartPhone can switch between the BT car kit and the headset on the fly WHILE carrying out a conversation, without dropping the call. But this requires to go through the Settings menu, Bluetooth settings, devices and setting a specific device to be bound to the handsfree profile. About 10 key presses, which will be difficult to execute quickly and correctly in the middle of a phone call. I've found no way to automate this transfer of role. Hence a macro utility that can fire off specific key presses.

Now that I have such a tool to play with, I'll probably think of other uses also :lol:

Thanks for your help and developing this tool!

Allan

Guest AllanHvass
Posted

First coding issue: The "Home" key on the SmartPhone is appearently not the same key as Home in your key code list, i.e. it doesn't map to the Home key on a PC. When this key code (36) is sent using the script, nothing happens, i.e. the SmartPhone doesn't return to the home screen. Other key codes are working as expected, so this is not a general scripting issue.

Any idea what key code to use for this?

Allan

Guest AllanHvass
Posted

I don't find a key code definition for VK_START anywhere on the Internet, though I did find the list of key code definitions from Microsoft on http://msdn.microsoft.com/library/default....ualKeyCodes.asp . I did try more than a dozen other codes that might have been interesting on that list, but nothing functioned as the "Home" button.

Time to go to bed. Ideas welcome...

Guest maxh2003
Posted

Ooops... *possibly* I meant "VK_LWIN 5B Left-Windows Key". You're right, it's getting late :-s

Guest AllanHvass
Posted

That did it. Better get it the next beta release of the documentation :lol:

Now, I'm already able to automate this - will finish it up tomorrow.

One note: There seem to be no input buffer using this macro tool, i.e. if the phone is not ready to have the key pressed yet, e.g. if it's still working on the previous key press, strange results will happen, either the next keypress will be ignored, or it will result in something else, e.g. start to dial a phone number.

Will probably have to use WaitForWindow to ensure that the phone is progressing through the right screens. Will test further on this tomorrow.

Thanks for the help again.

Allan

  • 4 months later...
Guest gpcarreon (MVP)
Posted

To maxh2003,

Thank you very much for this fantastic scripting program! :)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.