[Windows Mobile Software Development] howdykeith:
Passing arguments through links

Quote:

Originally Posted by howdykeith

Run("\Programas\HomeScreen PlusPlus\omnia\apps\contacts.mscr", "contact_no=2")

i assume that works?

No, that wouldn't work... file associations like ".mscr" don't allow passing parameters. What SHOULD work is to include the "AUTORUN.EXE" from the MortScript package renamed as "contacts.exe", and using

Code:

Run("\Programas\HomeScreen PlusPlus\omnia\apps\contacts.exe", "contact_no=2"Could also link directly to contacts.exe in a .lnk file, or the HS++ .xml.

Just have to be sure you use an AUTORUN.EXE that supports passing the parameters to MortScript.exe... I don't think the ones in v4.2 does, but the one in the latest beta (v4.3b15) does, and will work even if using the v4.2 MortScript.

The "auotrun.exe" will run the script of the same name (if you name AutoRun.exe as xxx.exe, it will look for xxx.mscr in the same folder). It will run it with either a MortScript.exe in the same folder, or if that is not found, looks for an installed version. Personally, I put a copy in the script's folder, to be sure it uses the version the script is made for (I use the betas with the @ syntax for calling functions, so they won't work in 4.2). Here is the location to get the latest beta (as of this post, at least, but the latest will always be in that thread), with the "AUTORUN.EXE" that supports passing parameters:

http://www.sto-helit.de/forum/viewtopic.php?p=12590#p12590

--------------------------------------------------------------------------------

Quote:

Originally Posted by howdykeith

i see.

ok.

in the manual, .lnk can be set up to pass parameters as well.

how about:

Code:

Lnk = SystemPath("ScriptPath") \ "testCatch."

CreateShortcut(Lnk & "lnk", Lnk & "mscr", True)

Run( Lnk & "lnk", "contact_no=2" )

Delete( Lnk & "lnk" )or

Code:

Lnk = SystemPath("ScriptPath") \ "testCatch."

CreateShortcut(Lnk & "lnk", Lnk & "mscr, contact_no=2" , True)

Run( Lnk & "lnk")

Delete( Lnk & "lnk" )doubt i got the syntax right.

i only ask cause i would rather not include those .exe stubs unless there were some other reason.

I'm afraid it wouldn't work (I wish it did)... Looking in the registry on the PC, these are the registry entries that allow ".mortrun" and ".mscr" files to run via MortScript (there should be similar entries for Windows Mobile, but it's easier for me to look it up on the PC):

Code:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.mortrun:

@="MortScript"

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.mscr:

@="MortScript"

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MortScript\Shell\Open\Command:

@="C:\Program Files\MortScript\MortScript.exe" "%1"As you can see, there is only one parameter allowed, and that is the name of the script to be passed to MortScript.exe. It's just the way Microsoft chose to handle "document associations".

I can already see the gears whirling in there, btw... "What if I add a %2 to that registry entry?" Sorry, but doesn't work.

code to open up a new sms (Blank message to type not inbox):

if you want a shortcut to new SMS you would open notepad, type

Code:

:MSINBOX -service -to""

save it, then just rename it from .txt(or whatever) to .lnk. I just use the links I have already, duplicate with Resco Explorer, and change the shortcut parameters.

Also, for a new email you would put:

Code:

:MSINBOX -service "Gmail" -to ""

Replace Gmail with the name of your email service.