PDA

View Full Version : StartOperaMini: Mortscript for *easily* launching and controlling Opera Mini!


badbob001
11th April 2008, 12:10 AM
10/20/2008: You may or may not notice that I haven't updated the script in a while. I had lost my windows mobile phone (t-mobile shadow) many months ago and I guess that killed my enthusiasm and any practical way to do testing (process detection doesn't work very well on the emulator). It also doesn't help that mortscript is frozen in time as well. Since I don't really see many Windows Mobile Standard devices coming out and I refuse to use a phone that requires a stylus, my next phone will likely be an android device (which interestingly enough, has an opera mini port).

There are probably a few bugs lurking around in the code for some fringe cases, but as always, you are welcomed to examine and update the script to your needs and it would be very appreciated if you would post a link to the update here. Also, I think JZ's SmartMort script is still keeping things interesting so you may want to check that out.


Latest version: 06/17/2008 0.11b
Faster Startup, Better OM control, Select / Copy / Paste (works in smartphone MS Word!), HotKey, and many fixes.


http://forum.xda-developers.com/attachment.php?attachmentid=93192&d=1213654819http://forum.xda-developers.com/attachment.php?attachmentid=93188&d=1213654819


INTRODUCTION

You probably know of Menneisyys' original thread (http://forum.xda-developers.com/showthread.php?t=347689) of making Opera Mini behave like the default browser by responding to links in emails and other locations. A component of making that work is a script to launch opera mini and enter the url. I've been enhancing my version of the script to make it easy to everyone to use.

While this script has some powerful options, its main purpose is to make it easy to launch opera mini directly and use opera mini to handle links.


At first run, an auto-detection process will try to automatically figure out how to launch opera mini and update your device so links are opened by Opera Mini. No more worrying about what jbed.exe parameters to use. Launching the script directly will open Opera Mini so you can just reference the script in shortcuts and launchers.


In previous versions of the script, you had to manually guess how much delay is needed before opera mini is ready for the script to enter the url. This script has method to detect if Opera Mini is running and if it's ready automatically.


If anything changed on your system that affects Opera Mini, just run Setup to re-detect your settings or tweak a setting. No text editing of the script required.


FEATURES

Make Opera Mini your default browser
When you run the script, the script will automatically find and launch Opera Mini. Optionally, update your registry so links in emails, contacts, appointments, documents, and other apps are handled by Opera Mini. Optionally, create a Start Menu shortcut with icon to launch Opera Mini.

Works with both Opera Mini 3.1, 4.0 and 4.1. Landscape and fullscreen mode is supported. Will work with 4.1 with Auto-complete Address Input enabled or not.


Quickswitch
Invoke the script with OM visible and you can have the script automatically option open the current page in IE and vice versa. This is handy when you encounter a page that would render better in the other browser. For example, in Opera Mini, you encounter a page with a youTube video so you quickswitch to IE to view the video.


Hotkey
You can assign a single hardware button to the HotKey shortcut and have quick access to most script features, including text select, copy, and paste commands.


Customizations / Special features

Enable prompting of what action to take when invoking a link or starting the script, such as asking which browser to use or sending the url to the clipboard. Timeout option available.
Add your own custom applications as choices to respond to links, so you can add browsers like netfront or opera.
Exclude list for sites that you want to automatically open in an alternative app like IE, such as your provider's private-network MMS server. Also good for automatically using IE to download files that Opera Mini may not handle correctly. Prompt and timeout option available.
Patch selector.utf file to eliminate permission prompting by midlets.
Create shortcuts to all your midlets in your Start Menu.





HISTORY

11/29/2007 0.01b: Initial version (based on Menneisyys' script) [details] (http://www.pocketpcmag.com/blogs/index.php?blog=3&title=major_breakthrough_my_latest_invention_n&more=1&c=1&tb=1&pb=1#c13580)
04/06/2008 0.02b: Next version (based on info from JZ's script) [details] (http://forum.xda-developers.com/showthread.php?t=347689&page=10#95)
04/10/2008 0.03b: Enhanced and uploaded to this thread
04/11/2008 0.04b: Fix: will find jbed.exe if even no quotes are around the registry value [details] (http://forum.xda-developers.com/showthread.php?t=384271#8)

04/11/2008 0.05b: landscape support, address input optimizations, improved DAI tolerance, shortcut with icon created, filename change to ini file. [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=2#13)
04/12/2008 0.06b: tweaked delay b/t keys and delay after paste [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=2#20)
04/15/2008 0.07b: Shortcuts created in localized Start Menu location, Prompt-less auto-configuration, Alternative url input methods, What to do options list, To kill jbed or not, 'Start Opera Mini Setup' [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=4#32)
04/22/2008 0.08b: More url paste options, Improved opera control scheme, Shortcuts add/remove options, More Setup functions, selector.utf patching, Reworked logic on when to kill jbed.exe [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=6#52)
04/25/2008 0.09b: Exclusion list, Last Link saved, Improved shortcut icons, help file [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=6#60)
Update: 04/25/2008 2:50pm EST: found a bug where trim would repeat forever. Fixed and re-uploaded. [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=7#64)
05/15/2008 0.10b: Custom Commands, Improved Exclude options, Prompting with timeout, Quickswitch, Special Commands, JVM selection improvements, Fixes [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=12#117)
UPDATE1: 05/15/2008 11PM EST 0.10b sp1: found some bugs with quickswitch if Use Direct Address Input is enabled. Fixed and re-uploaded.
UPDATE2: 05/16/2008 12PM EST: 0.10b sp2: got quickswitch working on my WM6 PDA by introducing context-menu methods for copy, paste, and select-all. Of course, only touch-screen devices have a context-menu. Also, you can choose different copy, paste, and select methods for use in OM and IE, which is important since context-menus don't appear to work within my JVM. Also added prompt and prompt timeout options to quickswitch [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=13#121)
UPDATE3: 05/20/2008 1:30PM EST: 0.10b sp3: more quickfix tweaks, more commands when using quickswitch prompt so the prompt is more like a context menu allowing to perform an action with the current url or task-switch between browsers. Also added a sample bookmarks.mscr script that you can add to your list of commands and use with quickswitch prompt to have a unified bookmark list between IE and OM. [details] (http://forum.xda-developers.com/showthread.php?t=384271&page=13#124)
06/17/2008 0.11b: Faster Startup, Better OM control, Select / Copy / Paste, HotKey, and many fixes. [details] ("http://forum.xda-developers.com/showthread.php?t=384271&page=14#138)


TO DO / KNOWN BUGS:

On some platforms, Mortscript will crash if it tries to read the clipboard containing a large amount of text (around 16KB+ on my smartphone). This is easy to do if you are editing a large document and do a select-all + copy. My script will detect the crash and offer to clear the clipboard contents so mortscript will not crash again if you repeat the same action.
When viewing a script dialog window, like a prompt window or a setup window, it is possible for another application come into focus and you will lose access to the script window. A common way this can happen is when you receive a phone call and the call window appears. My script will automatically check if its dialog windows is in focus and if not, it will try to bring it to focus. This usually works but I've seen where the script only manages to get the title bar to appear but the rest of the screen still shows the previous application. User inputs will be focused on the script though you can't visually see the results. If this scenario occurs, just wait a few minutes and mortscript will eventually bring the dialog window back in focus. If you can't wait, you can kill mortscript via HotKey > StopScripts or manually run \sub\stop_scripts.


Be sure to download the version you want. I'm keeping some of the previous version up in case of bugs or undesired behavior in the latest version.

badbob001
11th April 2008, 12:11 AM
http://forum.xda-developers.com/attachment.php?attachmentid=93189&d=1213654819

http://forum.xda-developers.com/attachment.php?attachmentid=93190&d=1213654819


REQUIREMENTS

Jbed JVM
Jbed 2.1: (recommended)
http://www.modaco.com/index.php?act=attach&type=post&id=23899

Jbed 3.1:
http://forum.xda-developers.com/showpost.php?p=2127317&postcount=65

Jbed 3.1 has a bug on smartphones where if you switch away from jbed and then switch back, the screen may not refresh. Workaround is to manually start the JVM, select Menu > Background Running, and finaly start Opera Mini. Script setting 'Kill JVM First' will need to be set to 'No'. This is also a good method to allow you to switch away from Opera Mini while it's still loading the page and come back when it's done. This will work for Jbed 2.1 as well.

If you have multiple versions of jbed installed, then the script may not correctly find the version you are using. You can run the Setup application and manually select your JVM executable and the selector.utf file that catalogs the midlets you have installed.

If you start the script to start Opera Mini and briefly see a flash of white, then either the script has chosen the wrong JVM/selector.utf pair or you recently installed a JVM that is of a different version from your last one. In the latter case, your currently installed midlets may not work with the newly installed JVM and you may need to uninstall all your midlets and reinstall them.
Opera Mini (3.1, 4.0, 4.1 beta, 4.1 Final)
http://www.operamini.com

To get the signed version of Opera Mini 4.1 Final so you're not prompted for permissions:


On the device, use IE mobile and go to http://mini.opera.com
(http://mini.opera.com)
The version shown is probably 4.1 US English, No signature, which is probably what you don't want so don't download that. If you're fine with the chosen language, skip to step 5. Otherwise, see the next step.
Click Download in another language.
Now a list of all language versions appear so choose one. I prefer to download Opera Mini 4.1 International for foreign language websites.
Click 'If this version fails to install or you would like to install a previous version, please click here.'
Choose the signed version you want.


Mortscript (4.1 or higher)
http://www.sto-helit.de/index.php?module=page&entry=ms_overview&action=view



INSTALLATION

Download Mortscript (4.1 and up), Jbed (2.1 preferred), and Opera Mini (signed version preferred) and install them. Make sure you can run Jbed and then run Opera Mini. You should run Opera Mini at least once to get pass all the initial installation and license agreement screens.


Extract the script contents to anywhere on your device. The zip file contents are stored in a \StartOperaMini\ folder so you can just extract that folder like to '\Program Files\Mortscript\StartOperaMini\'.


In version 0.09b and 0.11b, the OperaIcon.dll is updated with better or additional shortcut icons. You may not be able to directly overrwrite the existing OperaIcon.dll file so rename the file to something else like OperaIcon.dll_, and then transfer the new OperaIcon.dll. A reboot may be needed before the old OperaIcon.dll can be deleted.

To support the new icons, the shortcuts have been modified, so you may need to update your shortcuts from the correct ones in the script folder or run Setup and toggle the Start Menu shortcut option to No and then back to Yes.

Also, you may be asked for permissions to load OperaIcon.dll when you access your Start Menu and the OS tries to load the icon graphics. Just allow it and the message shouldn't appear again.



Open file manager, navigate to where you copied StartOperaMini to, and run StartOperaMini.mscr. If this is the first time you're running the script from the current location, then the script will initialize by detecting your JVM and Opera Mini settings and ask you some initial setup questions.

One important question is if you want to register the script so the script is run when you click on a link in emails, documents, etc. This step is optional, but is helpful in making Opera Mini behave like the default browser. If you skip this step but have another version of the script installed elsewhere that is registered, then clicking an email link will open up the other version of the script.

When Opera Mini opens up, installation is complete. Note that version 0.11b does not support the settings from previous versions so you may need to revise the initial settings.


If you want to run the script from an application launcher, either link to the 'Start Opera Mini' shortcut or link directly to the StartOperaMini.mscr script.

If you want to use the HotKey feature to easily access other script commands like copy/paste, you should map a hardware key to the shortcut 'Start Opera Mini Hotkey' and then customize the HotKey function in Setup. View the help file if you need more information.

If you need to change any settings, just run the shortcut 'Start Opera Mini Setup'. View the help file if you need more information.


LIMITATIONS

When opening links to local files or to sites on private carrier networks (portals, MMS server), Opera Mini will fail to get to that address. Run setup and add the host to the exclude list of those links will open in IE instead.
If Internet Explorer is opened, links in contacts and appointments may automatically still use Internet Explorer. Workaround is to kill Internet Explorer first, which is an option in the Setup program.
Some paste and control methods may not work on certain devices, so try different settings in Setup.



UNINSTALLATION

Run the Setup Program and then select the Uninstall option.
Delete script files from the script folder. You may not be able to directly delete the OperaIcon.dll file since the system may still be using it to display the shortcut icon. Rename the file to something else like OperaIcon.dll_, reboot, and then it should be deletable.



THANKS

Much thanks to Menneisyys for giving birth to this breakthrough idea and for JZ SmartMort for bringing new innovations to the table (check out his JZ SmartMort (http://forum.xda-developers.com/showthread.php?p=2080379) tool). Much ideas and help is from the community so it's really due to everyone's efforts.

Feel free to enhance the script to your own needs and use it in your own projects.

badbob001
11th April 2008, 12:12 AM
[reserved for future use 2]

volwrath
11th April 2008, 02:26 AM
Hi badbob.

I kind of like the script that you made way back when (Nov.?) that opens up a popup that lets you choose between PIE and OM and the clipboard. It also works for 4.1. It would be neat if the installation script allowed that as an option, and also detected Opera Mobile (and skyfire in the future) and would allow that as an option. Having said that dont make these additions for me as I am happy running the old script. Just thought id give you a suggestion.

famewolf
11th April 2008, 02:52 AM
Great script..does what it's supposed to and does it well....do you have any issues with it being included with a rom?

Azimuth21
11th April 2008, 05:39 AM
Thanks for the script; nice little workaround using the color of the upperleftmost pixel. One thing I've noticed is that I have direct address input turned off in my Opera Mini 4.1. However, I must check "Yes" when asked if it's turned on. Only then will it work properly. Don't know if I'm just reading wrongly, but other than that, it's working perfectly.

By the way I'm using the JBed_20071119.3.1_3dMod_HeapSizeFix_v2_wm6(lovetz1 ) cab.
It found my jbed.exe, even though it's in a "Jbed3dmod" folder on my storage card.

Overall, it's working great now that I marked off "Yes". Thanks!

badbob001
11th April 2008, 05:45 AM
Great script..does what it's supposed to and does it well....do you have any issues with it being included with a rom?

No problems. Go ahead.

badbob001
11th April 2008, 06:06 AM
Replaced

jbed_exe_ini = Part(RegRead("HKCR","jarfile\Shell\Open\Command",""),"""",2,1)


with

jbed_exe_ini = replace(RegRead("HKCR","jarfile\Shell\Open\Command",""),"""","")
jbed_exe_ini = SubStr(jbed_exe_ini, 1, find(jbed_exe_ini, "jbed.exe")+7)


So finding the location of jbed.exe from the registry doesn't depend on the quotes being around the command.

badbob001
11th April 2008, 06:22 AM
One thing I've noticed is that I have direct address input turned off in my Opera Mini 4.1. However, I must check "Yes" when asked if it's turned on. Only then will it work properly.

When you have direct address input (DAI) turned off in both OM and the script, at what point does the script fail?

The following two block of instructions is what the script does when it thinks DAI is turned off.


LeftSoftKey [open menu]
LeftSoftKey [select Enter Address]



[select all text]
[paste url over selection]
LeftSoftKey [click OK]


By just being lucky, leaving the script with direct address input turned on will perfectly work even if OM has it turned off. It's just that the extra keys sent don't cause any problems. In your working scenario, having the script think DAI is on will essentially put an extra 'enter' after the first instruction block and then another 'enter' after the second block. Which 'enter' is the one helping you?

badbob001
11th April 2008, 06:41 AM
Hi badbob.

I kind of like the script that you made way back when (Nov.?) that opens up a popup that lets you choose between PIE and OM and the clipboard. It also works for 4.1. It would be neat if the installation script allowed that as an option, and also detected Opera Mobile (and skyfire in the future) and would allow that as an option. Having said that dont make these additions for me as I am happy running the old script. Just thought id give you a suggestion.

It's relatively easy to slap on the menu option to my script, which tmknight did here (http://forum.xda-developers.com/showthread.php?t=347689&page=13#130).

I'm sure many "power" users will want total control and it's pretty easy to make a script that defers the decisions to the user. But I wanted to try a script that is a bit more friendly and tries to handle decisions on its own... a script that I won't be afraid to put on my wife's phone. Easy is hard. :)

Azimuth21
11th April 2008, 07:48 AM
When you have direct address input (DAI) turned off in both OM and the script, at what point does the script fail?


By just being lucky, leaving the script with direct address input turned on will perfectly work even if OM has it turned off. It's just that the extra keys sent don't cause any problems. In your working scenario, having the script think DAI is on will essentially put an extra 'enter' after the first instruction block and then another 'enter' after the second block. Which 'enter' is the one helping you?

Sorry, forgot to clarify. I believe the first enter is helping me, because: if I choose the "No, DAI is Off" option, the script will open up Opera Mini, and stay at the main screen for a few seconds. Still on the OM main screen, the script will say something like "The input box was not found after _ seconds", then ask if I want to go through setup again. If I choose the "Yes, DAI is On" option, everything works normally. Opera Mini opens, the input field is opened, the link is pasted into the input field, the page loads, etc.

bluemetalaxe
11th April 2008, 08:44 AM
Thanks for sharing but on my xda is a german software running called "DK - OperaMini4 Addon" with mortscript 4.1 that does the same as yours. and its out since months. so where are the big news? the only better thing seems to be the autodetecting when mortscript starts running, but you write that this don` t work in mini Landscape mode. but everyone i know uses this mode.

badbob001
11th April 2008, 10:44 PM
04/11/2008 0.05b

- (Opera's built-in) Landscape support:
I now test pixels in the upper left (0,0)and upper right (screenwidth()-1,0) to determine when Opera is running and what orientation it is. I'm not too sure how consistent the upper right pixels are on different devices, but it works fine on my wm6 standard qvga phone. Knowing the orientation is important since in landscape, you have to now press left or right instead of up and down to open the address bar drop down.

- Slightly improved address input:
The script originally sent [leftsoftkey] to open the opera menu and another [leftsoftkey] to select the 'enter address' option. Since I restart Opera Mini if an url needs to be pasted, the initial cursor is already on the address input box, so I just need to send one [enter].

At least on my device, if Direct Address Input (DAI) is on, a rare case occurs where I need to send an extra [enter] to have Opera submit the url. It doesn't appear to cause any ill effects if two [enter]s are sent every time when using DAI.

- Improved tolerance of mismatch DAI setting:
Some people may notice that if you have DAI (Direct Address Input) disabled in Opera but enabled in the script, the extra keys sent by the script don't cause any problems except for being a micro-fraction slower.

For the opposite scenario where if you have DAI enabled in Opera but disabled in the script, the previous result was that the script will complain that it didn't find the Address Input window. Now when it doesn't find the Address Input window, it will assume DAI is really turned on and send the extra DAI keys. If that doesn't work, then you it will complain. But if does, it'll continue with no problems. The *next* time you run the Opera Mini, the script will say that it thinks you told it the wrong DAI setting and offers to run the setup wizard for you to enter the correct settings.

- Start Menu Shortcut with icon
The setup wizard will add a 'Start Opera Mini' shortcut to your Start Menu and it will have the Opera icon:
Kevxross here: http://forum.ppcgeeks.com/showthread.php?t=7346 embedded the opera icon in a dll so it can be referenced by shortcuts. I've included the .dll in the .zip, so just copy it to the same location as the script.

- Ini file renamed
The only manual step that users may need to do is delete the .ini file if they want to easily get the setup wizard to run again. But I noticed that the built-in file manager will hide the extension of files and so users can't really tell the ini file from the script. I've renamed the ini file to <scriptname>_ini.txt. If you're upgrading, the script will automatically rename the existing .ini to _ini.txt.

volwrath
11th April 2008, 11:56 PM
It's relatively easy to slap on the menu option to my script, which tmknight did here (http://forum.xda-developers.com/showthread.php?t=347689&page=13#130).

I'm sure many "power" users will want total control and it's pretty easy to make a script that defers the decisions to the user. But I wanted to try a script that is a bit more friendly and tries to handle decisions on its own... a script that I won't be afraid to put on my wife's phone. Easy is hard. :)

Heh I understand completely. I was able to successfully modify your previous script, so its good by me :)

bluemetalaxe
12th April 2008, 01:42 AM
here`s the link to the software that does work like yours[/B]. This is out for 2 or 3 months but your welcome to develope the same twice:;):
Makes as direct shortcut to Opera mini including opera icon and opens urls with mortscript 4.1 ("Opera Mini addon direkt"):
http://www.ppc-welt.info/community/showthread.php?t=122764

mskovrinskie
12th April 2008, 04:46 AM
Is there a version of this script for smartphone? It works great for PPC, but copy and paste doesn't exist on WM 6.0 standard and fails on my BlackJack II.

famewolf
12th April 2008, 05:08 AM
here`s the link to the software that does work like yours[/B]. This is out for 2 or 3 months but your welcome to develope the same twice:;):
Makes as direct shortcut to Opera mini including opera icon and opens urls with mortscript 4.1 ("Opera Mini addon direkt"):
http://www.ppc-welt.info/community/showthread.php?t=122764

We are so happy you found a similar script months ago. You've posted about it twice now within 6 posts of each other. Please stop harassing the author of this one as several of us are quite happy with his script. Does the old script still use wait states? The new one doesn't. Does the old one automatically find your jbed even if it's on a storage card and find the slot opera is installed in no matter which one you used? The new one does. Finally his current version works with landscape. The entire page you referenced is in a foreign language and I for one appreciate support from an author who can communicate without the need to use babelfish.

cheesiest
12th April 2008, 07:12 AM
Hi badbob and all.
Thanks to everyone who contributed to this script. I'm lovin this.
I'm running Opera Mini 4.1 (v. 4.1.10781, 20080401 to be exact) on a Sprint Mogul / HTC Titan. After installation and first-time setup the script correctly launched OM and pasted in the link. However the page did not load. I had to manually hit the enter key to make it start the loading process.
After poking around in the script for a while I managed to make it load automatically. Around line 320 in the StartOM subroutine I added a wait between the two sendcr commands.

if ((opera_version_ini eq "4.1" AND direct_address_input eq True) OR (tried_again = True))
sendcr
sleep(wait_time_between_keys)
sendcr
endif
I don't know whether I fixed a script bug or my phone just has special needs.

samy.3660
12th April 2008, 07:38 AM
Great work i was thinking of the same thing today.
Thanks alot.

badbob001
12th April 2008, 08:21 AM
Hi badbob and all.
Thanks to everyone who contributed to this script. I'm lovin this.
I'm running Opera Mini 4.1 (v. 4.1.10781, 20080401 to be exact) on a Sprint Mogul / HTC Titan. After installation and first-time setup the script correctly launched OM and pasted in the link. However the page did not load. I had to manually hit the enter key to make it start the loading process.
After poking around in the script for a while I managed to make it load automatically. Around line 320 in the StartOM subroutine I added a wait between the two sendcr commands.

if ((opera_version_ini eq "4.1" AND direct_address_input eq True) OR (tried_again = True))
sendcr
sleep(wait_time_between_keys)
sendcr
endif
I don't know whether I fixed a script bug or my phone just has special needs.

I'm not quite sure how to classify this issue. My code originally only had one sendcr in that section. Then on the rare occasion, I'll see the pasted url in the address field waiting for me to hit enter to submit it. I do notice that everytime I see this happen, the last character in the pasted url is a square box, which means a character the device can't display. I figured, what the hey, lets add another sendcr in there and be done with this problem.

But I guess that didn't really solve the problem. I'm now guessing that I'm not allowing enough time for the device to receive the entire text from the paste before moving on to the next command. So maybe the device is still processing the long url text being pasted and ignores the later key commands. And maybe it also needs a little more time to switch from the text input screen back to opera mini.

I've added more delay after the paste and after leaving the text input window. See version 0.06b for this tweak and see if it helps. I've also taken out the second sendcr. If it works reliably, then the delays fixed it.


SendCtrlKey("V")
Sleep(500)
SendLeftSoft

if ((opera_version_ini eq "4.1" AND direct_address_input eq True) OR (tried_again = True))
Sleep(500)
sendcr
endif

badbob001
12th April 2008, 09:06 AM
Is there a version of this script for smartphone? It works great for PPC, but copy and paste doesn't exist on WM 6.0 standard and fails on my BlackJack II.

Copy and paste can exist on wm6 standard because that is what is on my phone, but each oem do modify the base os for better or worse.

I have see versions of this method where each key is sent to the device one at a time, which is much slower than pasting. Even worse, this method may result in each key occurring twice: aabbcc instead of abc and people have resorted to enter a, delete duplicate a, enter b, delete duplicate b, ...

Before we go there, lets get some info.

Lets assume you have opera mini 4.1 with direct address input turned on. LeftSoftkey (menu), LeftSoftKey (select Enter Address). Address bar up top should be in focus. Press Up twice to select 'Insert Symbol' and hit enter to open address input window. In the upper right of the screen, what input type is selected? ie: abc, t9, 123? On my device it's 'abc'.

JZ SmartMort's tool has a lot of options for testing copying and pasting on devices.
http://forum.xda-developers.com/showthread.php?t=382043

In his tool, an alternative to Ctrl-v is Shift-insert. I know, who uses that!? Lets try it on your device.

Open StartOperaMini.mscr in notepad and find:

SendCtrlKey("V")


replace it with

SendInsert ("",0,1)


and see if it works better. Also, before the paste, the script does a ctrl-home and ctrl-shift-end to select the "www." Does that happen on your device?

badbob001
12th April 2008, 09:11 AM
Sorry, forgot to clarify. I believe the first enter is helping me, because: if I choose the "No, DAI is Off" option, the script will open up Opera Mini, and stay at the main screen for a few seconds. Still on the OM main screen, the script will say something like "The input box was not found after _ seconds", then ask if I want to go through setup again. If I choose the "Yes, DAI is On" option, everything works normally. Opera Mini opens, the input field is opened, the link is pasted into the input field, the page loads, etc.

When it's 'waiting' at the main screen before the message about the input box not found, did even the left opera menu pop up? I'm guessing I didn't give enough time for opera to fully start before sending keys to it and it missed the first few. In the most recent updates, I've added an extra delay after the script thinks opera has started. I hope that helps.

JZ SmartMort
12th April 2008, 09:59 AM
Open StartOperaMini.mscr in notepad and find:

SendCtrlKey("V")


replace it with

SendInsert ("",0,1)


and see if it works better. Also, before the paste, the script does a ctrl-home and ctrl-shift-end to select the "www." Does that happen on your device?

mskovrinskie please let us know if this fixes the BlackJack II issue. Very strange how MS emulators (every kind of WM5 & WM6 device) test w/o a problem but some manufacturers stripped out certain API calls on their devices. I keep seeing more and more references to that effect...

dodo-dk
12th April 2008, 10:37 AM
Hi badbob001

I have made the little German Opera AddOns.

Thank you for your good work. I can´t do something like this because i´m too stupid.

But i have a better thing for your Script.

This is working with or without Direct Adress Input and with Jbed Softkey Bug from Orbit 2 and Star:

SendLeftSoft
Sleep(100)
SendCR
Sleep(100)
SendEnd
SendBackspace
SendBackspace
SendBackspace
SendBackspace
SendUp
SendCR
Sleep(100)

SendCtrlKey("V")
Sleep(100)
SendLeftSoft
Sleep(100)
SendCR

And the 4 Backspaces is to remove the "www." Because with this:

SetClipText(url)
SendHome ("",1,0)
SendEnd ("",1,1)

Don´t work with any SoftKeyboards. With some Softkeyboards-Software this don´t work. You need the 4 Backspaces.

By Dodo, sorry for my bad english.

mskovrinskie
12th April 2008, 01:42 PM
Copy and paste can exist on wm6 standard because that is what is on my phone, but each oem do modify the base os for better or worse.

I have see versions of this method where each key is sent to the device one at a time, which is much slower than pasting. Even worse, this method may result in each key occurring twice: aabbcc instead of abc and people have resorted to enter a, delete duplicate a, enter b, delete duplicate b, ...

Before we go there, lets get some info.

Lets assume you have opera mini 4.1 with direct address input turned on. LeftSoftkey (menu), LeftSoftKey (select Enter Address). Address bar up top should be in focus. Press Up twice to select 'Insert Symbol' and hit enter to open address input window. In the upper right of the screen, what input type is selected? ie: abc, t9, 123? On my device it's 'abc'.

JZ SmartMort's tool has a lot of options for testing copying and pasting on devices.
http://forum.xda-developers.com/showthread.php?t=382043

In his tool, an alternative to Ctrl-v is Shift-insert. I know, who uses that!? Lets try it on your device.

Open StartOperaMini.mscr in notepad and find:

SendCtrlKey("V")


replace it with

SendInsert ("",0,1)


and see if it works better. Also, before the paste, the script does a ctrl-home and ctrl-shift-end to select the "www." Does that happen on your device?

I just tested following your steps on the BJ II (using Rebeiro Jbed). For the first test, Insert Symbol resulted in 'abc' text entry mode.

I swapped out the SendCtrlKey for SendInsert. This worked better and I could see the URL being pasted correctly, though there were two extra characters at the beginning of thestring. http://www.google.com resulted in $#http://www.google.com. The same occurs with DIA off and resetting the script to run without DIA.

With the original script (SendCtrlKey), I see $#V being inserted (no URL). It seems that these extra junk characters ($#) are being passed no matter what.

monchatsam
12th April 2008, 03:01 PM
Many Thanks for your script, its perfect.

I just change a line on the script for my french rom for the ink because my Windows\Start Menu\.. is called Windows\Menu Démarrer\..

So thanks again :)

ChefChaudart
12th April 2008, 05:24 PM
Many Thanks for your script, its perfect.

I just change a line on the script for my french rom for the ink because my Windows\Start Menu\.. is called Windows\Menu Démarrer\..

So thanks again :)


Same comment :D:D:D

smoky334
12th April 2008, 07:11 PM
Hello,

I like the script very much.

Would it be possible to start a GPRS connection when the script runs. So that there is already a GPRS connection active when OperaMini wants to connect. That saves some time.

Smoky

cheesiest
12th April 2008, 08:51 PM
I've added more delay after the paste and after leaving the text input window. See version 0.06b for this tweak and see if it helps. I've also taken out the second sendcr. If it works reliably, then the delays fixed it.


SendCtrlKey("V")
Sleep(500)
SendLeftSoft

if ((opera_version_ini eq "4.1" AND direct_address_input eq True) OR (tried_again = True))
Sleep(500)
sendcr
endif

Yep, that fixed it for me. Well done!

Azimuth21
14th April 2008, 04:50 AM
Something curious I've noticed. I was reading RSS feeds earlier today, and I clicked a link to Read More. Opera Mini opened up, opened up the page, all was good. So I minimized Opera Mini when I was done, for faster access when I want to Read More on something else. When I got to the new feed I wanted to read more about, I clicked the link, and Jbed closed itself, opened again, then the Opera Mini process worked through. Is there a way to prevent Jbed from closing itself? Perhaps add a line in the script to check if it's running already?

JZ SmartMort
14th April 2008, 06:20 AM
Something curious I've noticed. I was reading RSS feeds earlier today, and I clicked a link to Read More. Opera Mini opened up, opened up the page, all was good. So I minimized Opera Mini when I was done, for faster access when I want to Read More on something else. When I got to the new feed I wanted to read more about, I clicked the link, and Jbed closed itself, opened again, then the Opera Mini process worked through. Is there a way to prevent Jbed from closing itself? Perhaps add a line in the script to check if it's running already?

You can always check the Opera history :)

MortScript allows us to use 2 things: Process name and window title.

I had issues trying to use either for this purpose. Especially with multiple versions of Opera. It all runs under one process, jbed.exe... it's a false assumption to think that it's Opera, it could be some other game or app running under jbed.exe. The window title just shows "Java" which gives us the same issue. I gave up on it (after about 2 hours) and said, kill and restart will work every time, guaranteed...

badbob001
16th April 2008, 06:22 AM
Shortcuts created in localized Start Menu location
Start Menu shortcut is now created in the localized Start Menu location using mortscipt's systempath("StartMenu") function. If it's still not right, just manually update this line:

start_menu = SystemPath("StartMenu")
# Command should auto-find locationized name of Start Menu.
# On english device, it should find: "\Windows\Start Menu".
# If defining manually, don't put a trailing \.

Thanks to the international community for reminding me of this.


Prompt-less auto-configuration
I didn't like how in the previous version, it will ask you if you have Direct Address Input (DAI) turned off or not. With the right combination of key sequences, it is possible to still insert the URL text in Opera Mini despite what the DAI settings is. Thanks to dodo-dk for reminding me of this. So now it's possible to run the script and have it bring up Opera Mini with no jarring question windows popping up. Other than problem-related messages, the only popup that may appear is if you have more than one version of opera mini installed and you are asked which one is to be made the default.


Alternative url input methods
mskovrinskie had some problems on his Blackjack II with ctrl-home, ctrl-shift-end and ctrl-v, which would produce the following characters respectively: $, #, and V. On my device, control-a would insert an 'a'. Key-combo support on WM is truly messed up. He also reports that shift-insert works on his device as an alternative to control-v. dodo-dk also reports that ctrl-home and ctrl-shift-end don't work on some devices with soft-keyboards.

The ctrl-home and ctrl-shift-end sequence is meant to select the address in the input windows so the new url can be paste over it. An alternative method is send four backspaces to delete 'www.'. One problem with OM 4.1 is that if the browser has already been to a page, the address input window will show the existing url, which will take more than four backspaces to delete. Solution is to send rightsoftkey > clear when using 4.1 and then complete with four backspaces.

As for getting the url text into the browser, nothing is faster than a paste. Now StartOperaMini has a second shortcut created in the Start Menu called 'Start Opera Mini Setup' (more info later) with some advance settings you can change if the defaults don't work for you. One option is to change the url text paste method. Choices are:
* Control-v
* Shift-insert
* (type one letter, backspace duplicate) repeat
* type entire url (backspace duplicate, left) repeat

The default method is shift-insert.

I got the idea to try shift-insert from the copy/paste options in JZ SmartMort's script. No idea where he got shift-insert from, but thanks!


What to do options list
Added back an option from a super-old version of my script where you can be presented a list of options. When a link is clicked, a list of choices appear asking which browser to open the link in or to copy the url to the clipboard. If just running the shortcut and you have more than one version of OM installed, a choice of which one to run is shown.

The default setting is to not to be prompted.


To kill jbed or not
Azimuth21 noticed that if OM is already running when a link is invoked, OM is restarted before pasting the link. This is by design because the pasting process needs the browser to be in a known state for it to work. There are times when OM is not killed and that is when starting the script with no url specified, which makes it a handy way to switch back to OM. But if you really don't like OM getting killed all the time, then I've put an option in 'Start Opera Mini Setup' to 'mostly' disable killing Opera. I say mostly because there are times when opera should be killed, such as when you enabled it so that you are prompted for which version of opera to run and only by killing the existing opera can it be guaranteed that the chosen version is run.

One known big limitation of not always killing opera is that full-screen mode is not supported for pasting urls. When in full-screen mode and not on the opera homepage, there is no familiar page element for the script to use to know opera is ready for receiving the url. One possible workaround for this small scenario is to use the old arbitrary wait times method after the automatic method fails. Anyone really interested in this? Why not just let OM be killed all the time?

Even if you don't mess with the above setting, I do have one scenario where you can keep the existing OM running. If you have enabled the feature for the script to prompt you on what to do when opening a link, it will also show this option: [Switch to already running Opera Mini]. Even though the script has no idea which version of Opera Mini is running, it'll assume it's 4.1 and that seems to work for both versions. The limitation of not supporting full-screen mode for pasting urls is still present.


'Start Opera Mini Setup'
I thought it was silly to make the user delete the ini file to reconfigure the script settings or to uninstall some features. That is why I made 'Start Opera Mini Setup'. You can find a link to it in the Start Menu and a duplicate link in the same folder as the script.

Note that you may NEVER need to run 'Start Opera Mini Setup'. The main script's auto-configuration should take care of most issues. 'Start Opera Mini Setup' is only for special case scenarios and people who like want options, especially the ones that break things.

Here you have the options to:

Change the default browser
Either select from different versions of Opera Mini, Internet Explorer, or be asked every time. Choosing Internet Explorer will update the registry so links are handled by IE and so this is essentially an uninstall procedure. Afterwards, you can of course still run the script shortcut to launch Opera. There is also an option to re-detect browsers, which replaces the old method of deleting the ini file first.


Change the url paste method
This was mentioned before.


Specify if DAI is enabled or not
Frankly, you really don't need to touch this... ever. As mentioned before, assuming that DAI is enabled even when it's not will not affect the results. The only benefit is that a handful of keys is not sent, which saves less than a second. The downside is that if OM has DAI enabled, url input will fail.


Kill jbed first
Mentioned before. Just leave this alone.


Start Menu shortcuts
Add or remove them. Shortcuts are automatically added when the script is run normally.



Little tweaks and fixes here and there.


Thanks for the input! I have to go clean up and update the documentation later.

dodo-dk
16th April 2008, 10:24 AM
Hi, the new Version Works very good.

Can i have your Permission to change the Script a little (language in Dialogs and the Shortcutname) and upload in my german Thread?

I upload the Link to the german Thread too, and put your Name and your DonationLink too in my german Thread -> only when you give me your permission.

Thank you very much!!

Sorry for my bad english.

Dodo

mskovrinskie
16th April 2008, 01:42 PM
I really like version .7 as far as the menu options, setup, shortcut, and configuration settings for prompting or just setting a default browser. Great work!

I'm still seeing inconsistent results on various phones:
1) Tilt - almost any settings work. Great experience
2) BlackJack II - The new insert method pastes the URL but now adds a '-' at the end. Type and delete is the only 100% accurate (and slow) method.
3) Pantech Duo - None of the paste methods full work. It seems as if the ability to insert characters or paste doesn't happen on this phone (maybe an issue with Mortscript?). I don't see any characters being pasted for any of the 4 options and combinations of DIA. Is there a way to further troubleshoot on this phone model?

badbob001
16th April 2008, 03:24 PM
Hello,

I like the script very much.

Would it be possible to start a GPRS connection when the script runs. So that there is already a GPRS connection active when OperaMini wants to connect. That saves some time.

Smoky

I don't think mortscript has the ability to control GPRS settings. I don't really know all the in's and out's of GPRS, but on my t-mobile usa phone, gprs/edge is always on. How do you turn yours on and off?

I'm guessing you turn off GPRS because you're charged per data or time usage and you don't want to accidentally have a program connect. I'm sure you can find a program that can turn your data connection on and off, and it would simple to have a script turn on gprs when starting, but when do you want it to turn off? When opera mini is closed? That would probably require another script to constantly check if opera mini is running. But this can get complicated if you use other internet applications at the same time which may be using the connection when the script turns it off.

tmknight
16th April 2008, 04:45 PM
Very slick badbob001!!!

I have one suggestion for the creation of the shortcuts. There may be instances where mortscript.exe is not associated with .mscr files so might be safer to create links explicitely calling mortscript.
Sub createShortcuts
if (not fileexists(SystemPath("StartMenu") &"\Start Opera Mini.lnk"))
WriteFile (start_menu &"\Start Opera Mini.lnk", "89#""" & mort_exe & """ """ & this_script & """?" & SystemPath("ScriptPath") & "\OperaIcon.dll,0")
WriteFile (SystemPath("ScriptPath") &"\Start Opera Mini.lnk", "89#""" & mort_exe & """ """ & this_script & """?" & SystemPath("ScriptPath") & "\OperaIcon.dll,0")
endif
if (not fileexists(SystemPath("StartMenu") &"\Start Opera Mini Setup.lnk"))
WriteFile (start_menu &"\Start Opera Mini Setup.lnk", "89#""" & mort_exe & """ """ & this_script & """ setup=1")
WriteFile (SystemPath("ScriptPath") &"\Start Opera Mini Setup.lnk", "89#""" & mort_exe & """ """ & this_script & """ setup=1")
endif
endsub

I'm also not a fan of forcing links in the startup menu (would rather choose to place it there).

start_menu = SystemPath("StartMenu") & "\Programs"


Again, these are merely suggestions - the script is VERY SLICK indeed! :D

Cheers!

badbob001
16th April 2008, 05:01 PM
I'm still seeing inconsistent results on various phones:
1) Tilt - almost any settings work. Great experience
2) BlackJack II - The new insert method pastes the URL but now adds a '-' at the end. Type and delete is the only 100% accurate (and slow) method.
3) Pantech Duo - None of the paste methods full work. It seems as if the ability to insert characters or paste doesn't happen on this phone (maybe an issue with Mortscript?). I don't see any characters being pasted for any of the 4 options and combinations of DIA. Is there a way to further troubleshoot on this phone model?

You have a lot of phones. I'm sure they belong to members of your family or friends, but even if you really own all these 'toys'... I"m glad. 99% of my code is for making the script super friendly and tolerant but I didn't spend too much time on testing different devices / configurations.

Anyway, I'm not really sure where that '-' is coming from. Try this:
1. Open the following attachment and save testtext.mscr to your device.
2. Open Opera Mini and open the address input window.
3. Switch away from Opera Mini and run testtext.mscr and it will guide you through some text input test.

See where this '-' is coming from or other anomalies. You may want to also try this on your Duo to see what happens.

Interesting finding 1:
The Address Input window when opened shows this:

[line 1]WWW.


If you press 'enter', rightsoftkey, 'enter' (to clear the screen), the window now shows:

[line 1]WWW.[]
[line 2]


where [] is a square. I suspect that square is a either the CR or LF portion of a newline character CRLF with the other half on line 2. This happens with Opera 4.0 and 4.0 under jbed 3.1 (20080222.3.1). This must be the mysterious [] character I reported earlier.

Interesting finding 2:
The address input window has a window title of 'Enter Address' so I may look for that window instead of doing another pixel color test for it. One possible reason it's not working on the Duo is that somehow the script is focused on another window when sending the keys. Perhaps if I specifically tell mortscript to send the keys to 'Enter Address'...

Not so interesting bug:
Also found a bug that only affects people that have Kill_Jbed_first set to NO (you freak), run opera 4.1, and had opera already running when invoking a link. Basically, I didn't properly comment a comment. On line 528, change


special case where 4.1 is chosen but 4.0 is already running


to


#special case where 4.1 is chosen but 4.0 is already running


Thanks!

badbob001
16th April 2008, 05:09 PM
Can i have your Permission to change the Script a little (language in Dialogs and the Shortcutname) and upload in my german Thread?


Go ahead. But please let me know here if your thread readers report any problems or have any fixes or suggestions. I'm sorry to say that I needed google translate to read that thread...

It would probably be a good idea to move most of the text from the script to variables in the beginning for easy localization... maybe for a later version.

Thanks!

badbob001
16th April 2008, 05:24 PM
I have one suggestion for the creation of the shortcuts. There may be instances where mortscript.exe is not associated with .mscr files so might be safer to create links explicitely calling mortscript.

Good point.


I'm also not a fan of forcing links in the startup menu (would rather choose to place it there).

The script will always create the shortcuts in the same folder as the script, so you can copy them to where ever you like, but I was a little torn about creating them in the Start Menu or not. I didn't like creating files outside of the script folder without permission, but the Start Menu does offer access to the shortcuts without the user first opening File Explorer. But the user most likely used File Explorer to first invoke the script so it should be ok for the user to go back there to run 'Start Opera Mini Setup' if needed and optionally use the option to add the shortcuts to the Start Menu.

I'll probably remove the auto-creation of the shortcuts in the Start Menu in the next version. Also doesn't hurt to make 'Start Opera Mini Setup' a little harder to access initially for those dangerously-curious types.

Thanks for the input.

tmknight
16th April 2008, 09:18 PM
You got me thinking, that since you are now prompting to use the existing JBED session, that it would be good to throw in a check to see if it is running opera and not some other applet. It seems this might be done by checking to see that "S#_d1.db (or any S#_d#.db) has the most recent last modified time stamp - the "S#" needs to correspond to the selector position of the identified opera version either in the script TXT file or through some other check, but the TXT file seems most appropriate. The ".db" file is modified as soon as opera is opened so if it has the most recent time stamp, then it is safe to assume that if JBED is running, then opera is running.

I'm only picking up on mortscripting as I follow along here, so won't be any help in accomplishing this, but thought it would put a nice bow on the script and all the other nice checks it is already doing.

Keep up the good work!


edit: mort 4.1 has a FileModifyTime function so just a matter of determining what file to look for and then seeing if it is newer than any other file in the directory...easy right ;)

badbob001
16th April 2008, 10:50 PM
You got me thinking, that since you are now prompting to use the existing JBED session, that it would be good to throw in a check to see if it is running opera and not some other applet. It seems this might be done by checking to see that "S#_d1.db (or any S#_d#.db) has the most recent last modified time stamp - the "S#" needs to correspond to the selector position of the identified opera version either in the script TXT file or through some other check, but the TXT file seems most appropriate. The ".db" file is modified as soon as opera is opened so if it has the most recent time stamp, then it is safe to assume that if JBED is running, then opera is running.


I only prompt if you enable the prompting of what to do. The default setting is to kill kill kill. :)

That is very interesting information. Thanks.

I'm rethinking the whole kill jbed before running idea. While killing jbed can potentially make the script work 99% of the time, it does cause some delay. I have reworked the opera detection system so it works even if an existing opera mini is in fullscreen mode and NOT on the home page... except in some rare situations.

Your .db timestamp idea will give me a clue if the existing jbed.exe process is opera mini, and if it is, to also know what version it is. So I would only kill jbed if opera mini is not running or if it's a different version from the user's choice.

How did a ten line script turn into this monster?

JZ SmartMort
16th April 2008, 11:18 PM
Your .db timestamp idea will give me a clue if the existing jbed.exe process is opera mini, and if it is, to also know what version it is. So I would only kill jbed if opera mini is not running or if it's a different version from the user's choice.

It's still an assumption because you have to believe that somebody could just open JBed by itself w/o launching a java app...

badbob001
17th April 2008, 12:16 AM
It's still an assumption because you have to believe that somebody could just open JBed by itself w/o launching a java app...

You're right. Too bad mortscript doesn't support reading how much memory a process is using. If it did, I guess I can check how much memory Jbed.exe is using when running and not running opera. On my device, just running jbed uses less than 5MB of ram. Launching Opera Mini uses more. No idea if it'll be the same on other devices and other versions of jbed. I guess one can do a baseline test: run jbed.exe, record memory usage, save to .ini file, kill jbed.exe.

Another idea is to have the script create some file when running opera mini and then launch another script that just constantly checks if jbed.exe (opera) is still running. If jbed.exe quits, delete the file. So if jbed.exe is running without the file, then it's not opera. If it's running and the file exists, then it's 'likely' to be opera. If the device gets reset while opera is running, something in the startup needs to delete the file if it exists. Of course, someone can quickly kill opera and run another midlet before the watcher script catches on... Or someone can kill the watcher script... Or someone runs opera outside of the script...

No real idea solution but this whole script is one big hack held together with sweat and luck anyway. :)

JZ SmartMort
17th April 2008, 12:23 AM
No real idea solution but this whole script is one big hack held together with sweat and luck anyway. :)

That's my point. We're writing a PDA level hack, not a desktop experience suite. Some things are overkill, I'm perfectly happy to restart my JBed everytime, Opera has a history after all. The more code, the slower the script... it's a tradeoff like anything else.

mskovrinskie
17th April 2008, 02:54 AM
You have a lot of phones. I'm sure they belong to members of your family or friends, but even if you really own all these 'toys'... I"m glad. 99% of my code is for making the script super friendly and tolerant but I didn't spend too much time on testing different devices / configurations.

Anyway, I'm not really sure where that '-' is coming from. Try this:
1. Open the following attachment and save testtext.mscr to your device.
2. Open Opera Mini and open the address input window.
3. Switch away from Opera Mini and run testtext.mscr and it will guide you through some text input test.

See where this '-' is coming from or other anomalies. You may want to also try this on your Duo to see what happens.

Interesting finding 1:
The Address Input window when opened shows this:

[line 1]WWW.


If you press 'enter', rightsoftkey, 'enter' (to clear the screen), the window now shows:

[line 1]WWW.[]
[line 2]


where [] is a square. I suspect that square is a either the CR or LF portion of a newline character CRLF with the other half on line 2. This happens with Opera 4.0 and 4.0 under jbed 3.1 (20080222.3.1). This must be the mysterious [] character I reported earlier.

Interesting finding 2:
The address input window has a window title of 'Enter Address' so I may look for that window instead of doing another pixel color test for it. One possible reason it's not working on the Duo is that somehow the script is focused on another window when sending the keys. Perhaps if I specifically tell mortscript to send the keys to 'Enter Address'...

Not so interesting bug:
Also found a bug that only affects people that have Kill_Jbed_first set to NO (you freak), run opera 4.1, and had opera already running when invoking a link. Basically, I didn't properly comment a comment. On line 528, change


special case where 4.1 is chosen but 4.0 is already running


to


#special case where 4.1 is chosen but 4.0 is already running


Thanks!

Yes, I have too many devices. BJ, BJII, Wizard, StarTrek, Pantech Duo, and Tytn II. They are toys AND used for customer work.

Interesting results from the test...

Pantech Duo: The test ran fine, though I had to turn off DIA or the first step failed tring to find the window 'Enter address'. After disabling DIA, all the test steps worked up until shift-insert abcdefg. Nothing was inserted!

BlackJack II:
0) OK
1) # entered with the END key
2) backspace leaves a W because extra # and not enough backspacing
3) ok
4) shift insert abcdefg adds '-' at the end

tallglasowater
17th April 2008, 04:38 AM
i have this program running great thanks to you guys. have it as my default browser. only problem im experiencing is that opera mini is not displaying all images and pictures on links and sites. but pie does. somebody please help

badbob001
17th April 2008, 06:00 PM
i have this program running great thanks to you guys. have it as my default browser. only problem im experiencing is that opera mini is not displaying all images and pictures on links and sites. but pie does. somebody please help

If you're talking about ALL sites, then perhaps you have this unchecked in Opera Mini:
[ ] Load images

noellenchris
18th April 2008, 12:19 PM
.7b seems to recreate the "Start Opera Mini Setup" shortcut in my startmenu everytime I start Opera with the shortcut "Start Opera Mini"..

Not a huge issue. I have to delete them after awhile....

Chris

monchatsam
19th April 2008, 10:18 PM
It's really a good script.

There is just a small thing for me to be perfect, to remove requests for permission before launching the connection ..

For this I am constantly forced to edit Windows \ Appdb \ selector.utf and change one line:
Put Domain = tckmax with the same number of characters, ie add spaces if necessary.

Is it possible to add this parameter choice from the menu of your script?

nathrinder
22nd April 2008, 07:22 PM
.7b seems to recreate the "Start Opera Mini Setup" shortcut in my startmenu everytime I start Opera with the shortcut "Start Opera Mini"..

Not a huge issue. I have to delete them after awhile....

Chris

Same problem here :D

tmknight
22nd April 2008, 08:26 PM
edit: my bad, oops!

badbob001
22nd April 2008, 11:15 PM
More url paste options
shift-insert+trim (removes last character)
control-v+trim (removes last character)
type (for devices where mortscript doesn't send double characters)


Improved opera control scheme
When sending keys to control opera, some devices produce unexpected characters when sent certain keys. For example, when 'end' is sent, instead of moving the cursor to the end of the line, a # is produced. Key input is now reworked and limited to:


leftsoftkey
rightsoftkey
backspace
enter
left, down, right


The DAI_enabled option is removed as the script is able to determine if DAI is enabled or not by seeing how the screen responds.

Also, there are two opera control methods: method1 and method2.


Method1 is similar to the old method where opera is control this way:
- start Opera
- if opera interface detected, send softkey+enter to open the address input screen.
Method1 is the default method and works perfectly fine unless you set tell the script not to kill jbed first (Kill jbed first: No). If you decide to use an existing opera session, there are some screens where there is no menu option to open the address input screen. Also, if opera is in fullscreen and not on the homepage, the script will also not know if opera is running. When encountering the last two scenarios, the script will fallback to killing jbed and trying again.



Method2 is slightly more elegant but may not be compatible with all devices. In method2, to open the address input window, it sends a #1, which works almost in any opera mini screen. Also, if opera is running in fullscreen, method2 will send a #4 to switch the screen to the homepage to allow itself to detect that opera is running, and then send a backspace to return to the previous page before sending a #1 to enter a new url.

Compatibility issue with method2:
The author of Mortscript has not yet fixed the double-character issue that plague some devices, so sending #1 will still send ##11.

In attempting to work around this issue, I tried sending virtual keys instead of actual characters. Since virtual keys do not have a '#' key, I do a shift-3 to produce '#'. A potential problem with this is that on devices with a different locale, shift-3 may not produce a #.

Another issue is that the virtual key trick seems to only work correctly on some versions of jbed. Method2 works with jbed 3.1 but not Jbed 2.1. Of course, this is may be device specific so it may work on your device. You can choose which method to use in the Setup app.

It is too bad that jbed 2.1 doesn't work well with method2 on my device since jbed 3.1 has a known problem on smartphones where the screen may not update if you switch away and back. Anyone else encounter this? One possible solution: if you run jbed and enable Background Running, the problem does not occur. But there doesn't appear to be a way to enable Background Running when launching a midlet directly. If anyone can figure out a way to enable Background Running for directly launched midlets, please let me know! Ideally, there is a commandline option to enable that feature. I've been searching jbed.exe but I can't figure out how to see what commandline options there are. Things like "-run" or "-install" are not in obvious text parts of jbed.exe so any binary hackers want to lend a hand?

There is really no advantage to method2 over method1 unless you set Kill jbed first: No AND run opera mini in fullscreen... other than seeing the cool transition effects in opera.



Shortcuts add/remove options
Start Menu shortcuts are no longer created by default. You can run Setup and choose the option to create or remove them. Shortcuts are always created in the script folder so you can copy them to where-ever you like.


More Setup functions
In Setup, added option to kill jbed.exe / iexplore.exe and to delete .ini file to return everything to defaults.

Also, setting Internet Explorer to be the default browser no longer simply restores the registry, but instead makes the script launch IE for you. To actually restore the registry to before, a Registry Setting uninstall option is available.


MSPIE
JZ SmartMort told me that some applications use :MSPIE to refer to the browser. On my WM6 smartphone, email links went to :DEFBROSWER while links in contacts and calendar went to :MSPIE. So I've updated the registry update function to include :MSPIE.

One side-effect of messing with :MSPIE is that it may cause the Internet Explorer shortcut to open the script instead, which may not be what you want. I've modified the :MSPIE value so that it passes an extra variable to the script so the script will know that you just want to launch Internet Explorer and then will launch it for you.

Also, each registry backup is now in a separate file in the script folder instead of a single file.


selector.utf patching
Someone asked about patching the selector.utf file to eliminate the permission prompts. I have done this but be *warned*: selector.utf is a binary file and mortscript can only work with text files, so it may result in jbed not seeing any of your installed midlets. So far, it seems to work, but I don't use that many midlets. Of course, a backup of the selector.utf is copied to the script folder before making changes.

What the patch does:

replace "domain=untrusted," with "domain=tckmax ,"
and
replace "domain=trusted," with "domain=tckmax ,"


Reworked logic on when to kill jbed.exe

When the ini file is missing or invalid.
When Kill Jbed first: Yes, default opera specified, url specified.
When choosing which opera to use for a link and not selecting [Switch to already running Opera Mini].
When the opera interface fails to be detected and a single retry is automatically attempted.

badbob001
23rd April 2008, 01:16 AM
Update: found a small bug affecting settings from saving. Please re-download.

nathrinder
23rd April 2008, 01:57 PM
It works well now ! Thanks for your work :D

badbob001
23rd April 2008, 05:03 PM
BlackJack II:
0) OK
1) # entered with the END key
2) backspace leaves a W because extra # and not enough backspacing
3) ok
4) shift insert abcdefg adds '-' at the end

I hope the new release will work for you since it now doesn't send an 'End' and has a shift-insert+trim option to get rid of the trailing '-' hopefully.

And perhaps some combination of the new options will allow it to work on your DUO as well.

badbob001
24th April 2008, 03:46 PM
i have this program running great thanks to you guys. have it as my default browser. only problem im experiencing is that opera mini is not displaying all images and pictures on links and sites. but pie does. somebody please help

After some browsing on this forum, I think I understand what your problem is and I responded here (http://forum.xda-developers.com/showthread.php?t=382088&page=10#99):


exclude my previous paste.... i've figured everything out, i have opera mini running as my default browser, and everything else i wanted. only problem i'm experiencing now is that when i click on picture mail messages through sprint, it loads the website link with opera mini, but it wont display any pictures that was sent to me through mms.... but they do display properly in IE. was wondering why its not loading my images but only works with internet explorer? any help would be great.This was touched upon back in november 2007 when the hack for using opera mini as the default browser was first emerging: link (http://www.pocketpcmag.com/blogs/index.php?blog=3&title=major_breakthrough_my_latest_invention_n&more=1&c=1&tb=1&pb=1#c13612)

Basically, opera mini works by having the webpage first load into Opera's central server before sending the page to you. This will not work if you're opening a locally stored html file or a website on a private network that the central Opera server has no access to. I think the sprint server that holds your mms images only allows access from sprint devices on the sprint network. IE connects directly to the network and so would have no trouble connecting to the sprint server.

In my StartOperaMini script, I automatically use IE to open local files. Perhaps I'll add an option to also use IE if the url contains certain user defined words, such as 'pictures.sprintpcs.com'.

Anybody else interested in an user defined exclude list so things like mms works? I'm don't use mms much so this issue slipped my mind a long long time ago.

mskovrinskie
25th April 2008, 02:45 AM
I hope the new release will work for you since it now doesn't send an 'End' and has a shift-insert+trim option to get rid of the trailing '-' hopefully.

And perhaps some combination of the new options will allow it to work on your DUO as well.

Sorry, I should have confirmed this earlier. The shift-insert+Trim absolutely does work on the BlackJack II. I had customized .8 to do this but now .9 does it out of the box!

Unfortunately, the Duo is just broken. I have tried everything, but it doesn't seem to be able to paste any text (maybe it failed on the copy), though the other keyboard commands seem to work in the script. The paste function (no matter what option I choose) results in nothing being pasted.

badbob001
25th April 2008, 04:48 AM
Unfortunately, the Duo is just broken. I have tried everything, but it doesn't seem to be able to paste any text (maybe it failed on the copy), though the other keyboard commands seem to work in the script. The paste function (no matter what option I choose) results in nothing being pasted.

So even the direct-type non-paste input methods don't work on the Duo? It would be strange if backspace and enter work but not other keys.

mskovrinskie
25th April 2008, 01:58 PM
So even the direct-type non-paste input methods don't work on the Duo? It would be strange if backspace and enter work but not other keys.

If I select Paste Type: type, then here is what happens
- click URL from email
- JBED launches
- Go to, insert symbol, blinking cursor with no text in the input field (it is apparently waiting for something). If I wait long enough, it goes back to the Opera Mini screen and a square is in the text entry field. Strangely, while it is waiting, if I hit OK early then I can see it pasting double characters in the address field.
- If I hit OK early and the paste type is type and delete, then I can see it putting in the correct URL.

I added some debugging and verified that the URL is indeed copying. The issue seems to be with pasting into the address. The script might be confused about the state or window detection on this device.

Also, I noticed that the script isn't able to detect portrait/landscape on this device. It always thinks it is portrait, regardless of the actual state. All of my testing above was done in portrait.

badbob001
25th April 2008, 02:08 PM
Exclusion list
Anything you add to this list will be searched against when invoking a link. If there is a match, Internet Explorer is automatically used instead. This is useful for sites on private networks that the central Opera Server has no access to, such as your carrier's portal site or MMS server.


Last Link saved
The last link is saved and visible in Setup so you can:

Open it again (perhaps after changing your browser choice)
Add the link's hostname to the exclusion list
Add the link to the exclusion list (for later editing to filter beyond the hostname level)



Improved Shortcut Icons
As you can see in the latest screenshots, I've changed the shortcut icon to a high-resolution one and have also given one to the Setup program.

Upgrade Considerations

As of version 0.09b, the OperaIcon.dll is updated with higher resolution icons for both shortcuts. You may not be able to directly overrwrite the existing OperaIcon.dll file so rename the file to something else like OperaIcon.dll_, and then transfer the new OperaIcon.dll. A reboot may be needed before the old OperaIcon.dll can be deleted.

To support the new icons, the shortcuts have been modified slightly. To update your existing shortcuts you can either:

Delete the two shortcuts in the script folder and then run the script normally. The two shortcuts in the script folder will be recreated with the new settings. Then you can copy the new shortcuts to where ever you need them.

or


Run the Setup program and toggle 'Start Menu shortcuts'. It's up to you if you want the shortcuts in the Start Menu or not but any change here will force a recreation of the shortcuts in the script folder.




Help File
The help file in Setup now gives you info on the options in Setup.
Attached for your preview.

badbob001
25th April 2008, 05:02 PM
If I select Paste Type: type, then here is what happens
- click URL from email
- JBED launches
- Go to, insert symbol, blinking cursor with no text in the input field (it is apparently waiting for something). If I wait long enough, it goes back to the Opera Mini screen and a square is in the text entry field. Strangely, while it is waiting, if I hit OK early then I can see it pasting double characters in the address field.
- If I hit OK early and the paste type is type and delete, then I can see it putting in the correct URL.

I added some debugging and verified that the URL is indeed copying. The issue seems to be with pasting into the address. The script might be confused about the state or window detection on this device.

Also, I noticed that the script isn't able to detect portrait/landscape on this device. It always thinks it is portrait, regardless of the actual state. All of my testing above was done in portrait.

Try the 0.09b version I just uploaded. When sending the url text, it specifies that the keys go to the 'Enter Address' window explicitly.

How do you know that the script always thinks opera mini is in portrait or not?

method1: to select enter address menu:
portrait: send leftsoft,selftsoft
landscape: send rightsoft,rightsoft

then if the 'Enter Address' window doesn't appear, it'll assume DAI is enabled and then for both methods:
portrait: senddown,sendcr
landscape: sendleft,sendcr

to select 'insert symbol'. The end result for any method is that the full-screen enter address screen should appear. If it doesn't, then something went wrong.

So if you notice the wrong menu opening, then it got the orientation wrong. In this version, it writes some debug information to file StartOperaMini_last.txt after a link is invoked.


Version: 0.09b
Orientation: portrait
UpperLeft: 527467
UpperRight: 527459
Active Window: Enter Address
OS: 5.2.1711
Mort: 4.1.0.5
Settings: kill_jbed(0)paste_type(shift-insert)opera_control(method2)


Here is what I look for:

portrait win: Upper-left: 527467
portrait full: Upper-left: 16249847
landscape win: Upper-right: 527467
landscape full: Upper-right: 16249847


Now if in landscape your upper-left color matches one of the portrait colors, then it may mistakenly think it's portrait.

And of course, the actual orientation of your device should not matter. I'm assuming that if you use your device in landscape mode and opera mini is in portrait mode, the script should correctly see that opera mini is in portrait mode.

Doesn't your device automatically go into landscape mode when the keyboard is opened? So you shouldn't need to set the orientation in opera itself since I think that's for portrait-only devices. If you set opera to landscape and then open the keyboard, wouldn't then Opera Mini rotate clockwise and have its top toward the dpad of your device?

badbob001
25th April 2008, 05:35 PM
For those people that prefer to be prompted for what browser to use for each link, does having the exclude list make you reconsider disabling the prompt?

If you encounter a link that you prefer to be opened in IE instead, just run setup, add an entry to the exclude list, and then click Open last link to have the link open in IE. Then edit the exclude list so similar links open in IE automatically.

mskovrinskie
25th April 2008, 08:25 PM
Try the 0.09b version I just uploaded. When sending the url text, it specifies that the keys go to the 'Enter Address' window explicitly.

How do you know that the script always thinks opera mini is in portrait or not?

method1: to select enter address menu:
portrait: send leftsoft,selftsoft
landscape: send rightsoft,rightsoft

then if the 'Enter Address' window doesn't appear, it'll assume DAI is enabled and then for both methods:
portrait: senddown,sendcr
landscape: sendleft,sendcr

to select 'insert symbol'. The end result for any method is that the full-screen enter address screen should appear. If it doesn't, then something went wrong.

So if you notice the wrong menu opening, then it got the orientation wrong. In this version, it writes some debug information to file StartOperaMini_last.txt after a link is invoked.


Version: 0.09b
Orientation: portrait
UpperLeft: 527467
UpperRight: 527459
Active Window: Enter Address
OS: 5.2.1711
Mort: 4.1.0.5
Settings: kill_jbed(0)paste_type(shift-insert)opera_control(method2)


Here is what I look for:


Now if in landscape your upper-left color matches one of the portrait colors, then it may mistakenly think it's portrait.

And of course, the actual orientation of your device should not matter. I'm assuming that if you use your device in landscape mode and opera mini is in portrait mode, the script should correctly see that opera mini is in portrait mode.

Doesn't your device automatically go into landscape mode when the keyboard is opened? So you shouldn't need to set the orientation in opera itself since I think that's for portrait-only devices. If you set opera to landscape and then open the keyboard, wouldn't then Opera Mini rotate clockwise and have its top toward the dpad of your device?

.9 doesn't work on my BlackJack II now with shift+insert+trim. It pastes the URL in then starts backspace/deleting. It continues to do so infinitely in OperaMini or even in the shell. I need to kill MortScript to get my phone back.

I have not tried .9 yet on the Duo (will do that tonight and get back to you). As far as knowing if it thought it was portrait or landscape, I verified this by adding some debugging messaging statements in the script in your function that detects for landscape or portrait.

badbob001
25th April 2008, 08:53 PM
.9 doesn't work on my BlackJack II now with shift+insert+trim. It pastes the URL in then starts backspace/deleting. It continues to do so infinitely in OperaMini or even in the shell. I need to kill MortScript to get my phone back.

Thanks for bringing that to my attention. Very strange bug. Who would think that this is correct:

repeat 1
sendright
Sleep(wait_time_between_keys)
sendbackspace
Sleep(wait_time_between_keys)
endrepeat


but this is wrong:

trim_length = 1
repeat trim_length
sendright
Sleep(wait_time_between_keys)
sendbackspace
Sleep(wait_time_between_keys)
endrepeat


This seems to work:

trim_length = 1
repeat(trim_length)
sendright
Sleep(wait_time_between_keys)
sendbackspace
Sleep(wait_time_between_keys)
endrepeat


0.09b fixed and re-uploaded.

mskovrinskie
25th April 2008, 08:58 PM
OK, .9 on the Pantech Duo does not work and here's the last log:
http://c.moreover.com/click/here.pl?j1390377590&f=2238


Version: 0.09b
Orientation: portrait
UpperLeft: 16249847
UpperRight: 0
Active Window: Enter Address
OS: 5.2.1620
Mort: 4.1.0.5
Settings: kill_jbed(1)paste_type(type)opera_control(method1)


The Duo is a strange phone. It is a portrait smartphone by default, but then has a slider for a keyboard that rotates to landscape.

I tried running again with different settings and saw this:
http://c.moreover.com/click/here.pl?j1390377590&f=2238


Version: 0.09b
Orientation: portrait
UpperLeft: 16249847
UpperRight: 0
Active Window: Enter Address
OS: 5.2.1620
Mort: 4.1.0.5
Settings: kill_jbed(1)paste_type(shift-insert)opera_control(me

badbob001
25th April 2008, 09:42 PM
OK, .9 on the Pantech Duo does not work and here's the last log:


So it looks like you're running OM portrait and in fullscreen mode. Is that correct? The active window right before the script sends keys is correct.

Maybe mortscript is just not able to send characters to your device while actual buttons like leftsoft and backspace work. Have you tried the latest beta version of Mortscript? http://www.sto-helit.de/index.php?module=download&action=view&entry=125

Also, which version of jbed are you running?

mskovrinskie
25th April 2008, 10:25 PM
Yes, OM portrait in fullscreen. The same thing happens when not fullscreen.
I was using the released version of 4.1. I just tried 4.11b7 and it fails too.
I have tried JBED cloudyfa, rubeiro, and ebenezer.

One odd thing with JBED on a portrait smartphone is that some of the windows don't go fullscreen. When in Opera mainscreen it is fullscreen, but the applet manager window and the Address Window actually end up showing "Esmertec Jbed MIDP 2.0: in the title bar and an empty area at the bottom of the screen that shows through to the prior app. Could this by why this is happening? This happens with all of the JBED installs on Smartphone portrait screens.

badbob001
25th April 2008, 11:48 PM
One odd thing with JBED on a portrait smartphone is that some of the windows don't go fullscreen. When in Opera mainscreen it is fullscreen, but the applet manager window and the Address Window actually end up showing "Esmertec Jbed MIDP 2.0: in the title bar and an empty area at the bottom of the screen that shows through to the prior app. Could this by why this is happening? This happens with all of the JBED installs on Smartphone portrait screens.

This is a known problem of jbed on smartphones. I have the same issue and shouldn't be related.

As for your Duo issue, one idea was to use tinyurl.com to create a link short enough for you to memorize so you can type it in manually.


http://tinyurl.com/api-create.php?url=http://www.google.com/


produces:


http://tinyurl.com/161


On PC/PocketPC, mortscript supports a download command so I can request and download the tinyurl and display it to you. I can't do the same on smartphones unless I use IE to replace the function of download() to display the tinyurl.

You love opera mini enough to want to try this? Just copy this over your old version, run Setup and select 'tinyurl' as a Paste Type. Then try a link. It'll go all the way to the Address Input screen and then launch IE to show you the tinyurl. Once you got it memorized, just hit back to switch back to opera and type in the url. It will speed things up once you have done this a few times so you can just press Menu > Previous Addresses, bring up an old tinyurl and just edit the last few characters...

badbob001
26th April 2008, 12:07 AM
Since we're trying silly things at this point, back when Menneisyys and I were trying to figure out how to get all this to work on WM6, one idea I had was to upload the link to a page and just have that page bookmarked in Opera Mini for easy access.

In the ideal situation, the script would launch IE to send a command like this:

http://somewebserver.com/joesmoe/create-redirect-page?url=http://myemailurl.com/yo


and a page is created/updated at

http://somewebserver.com/joesmoe/

that just contains a redirect command to the specified url. So then in Opera Mini, just go to

http://somewebserver.com/joesmoe/redirect-page.html

and it'll automatically go to the email link.

I wonder if there are any existing sites or services that can do something similar. I guess you can even use a blogging site and send it links and then view those links from opera. The important thing is that the link needs to be uploadable from within the url, like how tinyurl.com does it:

http://tinyurl.com/api-create.php?url=http://www.google.com/

mskovrinskie
26th April 2008, 01:13 AM
I do like OM and the tinyurl test script does work, but it kind of loses the simplicity I am looking for.

I think I'll just stick with the Tilt and the BlackJack where .8 works perfectly. :)

badbob001
26th April 2008, 07:42 AM
If I select Paste Type: type, then here is what happens
- click URL from email
- JBED launches
- Go to, insert symbol, blinking cursor with no text in the input field (it is apparently waiting for something). If I wait long enough, it goes back to the Opera Mini screen and a square is in the text entry field. Strangely, while it is waiting, if I hit OK early then I can see it pasting double characters in the address field.
- If I hit OK early and the paste type is type and delete, then I can see it putting in the correct URL.

Re-reading your testing on the Duo, it does look like if you press OK to get out of the Address Input window, mortscript is able to type text into the Direct Address Input field. Am I correct on this?

In this test version, I have a setting in Setup called: 'Use Direct Address Input'. If you set it to yes, then the script will assume you have DAI enabled in opera and will try to enter the url directly into that field and not go through the 'insert symbol' route.

On my pocketpc device, this worked well with Paste Type: type-then-delete. Type-and-delete didn't work as well as it left some duplicate letters. I really hope mortscript fixes this duplicate letter issue in the next release! Since your device has a full keyboard, DAI may not be screwed up for you like on devices with number pads. Tried this on my smartphone and it can type in the url but messes up the url if it contains any numbers.

mawst95
26th April 2008, 08:56 AM
For those people that prefer to be prompted for what browser to use for each link, does having the exclude list make you reconsider disabling the prompt?

If you encounter a link that you prefer to be opened in IE instead, just run setup, add an entry to the exclude list, and then click Open last link to have the link open in IE. Then edit the exclude list so similar links open in IE automatically.

One thing I like is to use a Choicedefault for browser. Give the option to choose, but with say a 3 second time out that will automatically chose your default browser.

mskovrinskie
26th April 2008, 02:05 PM
Re-reading your testing on the Duo, it does look like if you press OK to get out of the Address Input window, mortscript is able to type text into the Direct Address Input field. Am I correct on this?

In this test version, I have a setting in Setup called: 'Use Direct Address Input'. If you set it to yes, then the script will assume you have DAI enabled in opera and will try to enter the url directly into that field and not go through the 'insert symbol' route.

On my pocketpc device, this worked well with Paste Type: type-then-delete. Type-and-delete didn't work as well as it left some duplicate letters. I really hope mortscript fixes this duplicate letter issue in the next release! Since your device has a full keyboard, DAI may not be screwed up for you like on devices with number pads. Tried this on my smartphone and it can type in the url but messes up the url if it contains any numbers.

.10btest2 works great with the option "Use Direct Address Input" and paste type: type then delete on the Pantech Duo. It works in both landscape and portrait.

Thanks for all your help on this!

caretaker22
26th April 2008, 02:37 PM
Mr. BAD!!

I just wanted to give you major props for this program... im really blown away thanks alot for your hard work! WOW!!

Edit- Is there anyway to create a script when click on youtube video, it will open play video/save/copy for tcpmp player? The only reason i use iexplore is for youtube. If a script can be create using mortscript to open this pop box linked to tcpmp player/flashbundle it will be the ultimate explorer! thanks

francesco85
3rd May 2008, 02:57 PM
At first run, an auto-detection process will try to automatically figure out how to launch opera mini and update your device so links are opened by Opera Mini. No more worrying about what jbed.exe parameters to use. Launching the script directly will open Opera Mini so you can just reference the script in shortcuts and launchers.

it's possible to have a similar script that launch others applets with this feature?

MaXTSM
4th May 2008, 05:56 PM
Hello M. Bad and thanks for this amazing work, this is exactly what i was looking for.

However i'm an opera mini 3.0 user (have no choice, only proxies used by 3.0 version are allowed by my carrier), your script works fine for everything except for url links. when i click a link opera mini is launched, but the "search" box is opened instead of the "enter address" box - then i get message "Did not find the address input window after xx seconds".

I suppose version 3 has different menu organisation that cause that problem, i tried to edit the script but could solve the issue. Could you please help or give me a clue ?

Thanks a lot

badbob001
5th May 2008, 10:28 AM
However i'm an opera mini 3.0 user (have no choice, only proxies used by 3.0 version are allowed by my carrier), your script works fine for everything except for url links. when i click a link opera mini is launched, but the "search" box is opened instead of the "enter address" box - then i get message "Did not find the address input window after xx seconds".

I suppose version 3 has different menu organisation that cause that problem, i tried to edit the script but could solve the issue. Could you please help or give me a clue ?

I haven't tested Opera Mini 3 with my script until you mentioned it. Does control method2 work for you? If not, try this edit in version 0.09b:

change this starting on line: 651:

if (opera_control eq "method1")
if (OMorientation eq "portrait")
SendLeftSoft
Sleep(wait_time_between_keys)
SendLeftSoft
elseif (OMorientation eq "landscape")
SendRightSoft
Sleep(wait_time_between_keys)
SendRightSoft


to


if (opera_control eq "method1")
if (OMorientation eq "portrait")
SendLeftSoft
Sleep(wait_time_between_keys)
SendCR
elseif (OMorientation eq "landscape")
SendRightSoft
Sleep(wait_time_between_keys)
SendCR


Over the past few versions, I had been alternating from sendleftsoft,sendleftsoft or sendleftsoft,sendcr to open the address menu. Sendleftsoft,sendcr sometimes doesn't work on my pda so I tried the other way. Method2 uses #1 to bypass the menu, but it may not be supported by your device. I'll test Opera Mini 3 in future versions. Thanks for the input.

badbob001
5th May 2008, 11:05 AM
it's possible to have a similar script that launch others applets with this feature?

This script will create a Start Menu subfolder called midlets that will contain shortcuts to all your midlets. Give it a try:

badbob001
5th May 2008, 11:12 AM
Is there anyway to create a script when click on youtube video, it will open play video/save/copy for tcpmp player? The only reason i use iexplore is for youtube. If a script can be create using mortscript to open this pop box linked to tcpmp player/flashbundle it will be the ultimate explorer! thanks

I don't know of a way for a script to know what you are clicking on in Opera Mini. You should ask the creators of Opera Mini to add such a feature. You may want to try one of the numerous apps out there made just for browsing online videos like vtap: http://www.vtap.com.

badbob001
5th May 2008, 11:13 AM
One thing I like is to use a Choicedefault for browser. Give the option to choose, but with say a 3 second time out that will automatically chose your default browser.

Wait for the next version... :)

N'da
5th May 2008, 05:21 PM
Hello, i've tried all the version but i've got the same error "unknow command setchoiceentryformat line: setchoiceentryformat (16,9, "courier")". I think it's a font error but i got cour.ttf in my windows folder. Can i change something in the script to work with tahoma.ttf or download the right courier font ?


Thanks for help.

badbob001
5th May 2008, 05:43 PM
Hello, i've tried all the version but i've got the same error "unknow command setchoiceentryformat line: setchoiceentryformat (16,9, "courier")". I think it's a font error but i got cour.ttf in my windows folder. Can i change something in the script to work with tahoma.ttf or download the right courier font ?

What version of mortscript are you running? An older version of mortscript may not have that command. I've only test mortscript version 4.1 and the newer betas.

Update: I've checked the mortscript 4.0 documentation and it doesn't mention the SetChoiceEntryFormat command.

A simple workaround is to just comment out that line:

Change:

SetChoiceEntryFormat( 16, 9, "Courier" )


to:

#SetChoiceEntryFormat( 16, 9, "Courier" )

N'da
5th May 2008, 06:29 PM
You were right because after installing your script i've installed another (tomtom switcher) that bring back my mortscript from 4.11beta to 4.0, now it's working like a charm. Thanks for your quick answer.

MaXTSM
5th May 2008, 09:45 PM
I haven't tested Opera Mini 3 with my script until you mentioned it. Does control method2 work for you?

I forgot to test method2 ! So, yes, we are making progress : with method2 the "enter address" box is shown correcly. However here is how the text in that box looks like :

www.#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4

"www." is not deleted and the script keeps adding "#4" until timeout is reached. Any idea about that behaviour ? I though there was a problem as I use opera mini 3.0 french version so i replaced the "Enter Address" occurences by the french name of the window, but it seems it did not change anything.

Thanks a lot for your help
Max

spangelsaregreat
6th May 2008, 12:52 AM
Hi

I have all the correct JBED, MortScript and Opera Mini 4.1 installed on my MDA Compact 3.

However, when ever I run the short cut it comes up with a message

"4.1.0.5 v0.09b

Java did not run after 5 seconds

Run Setup?"

I can see that JBED does run for a second or two but then seems to close before the above message is displayed.

Any solutions.

Thanks

badbob001
6th May 2008, 04:43 AM
I forgot to test method2 ! So, yes, we are making progress : with method2 the "enter address" box is shown correcly. However here is how the text in that box looks like :

www.#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4#4

"www." is not deleted and the script keeps adding "#4" until timeout is reached. Any idea about that behaviour?

Are you using jbed 3.1? On my device, only jbed 3.1 worked correctly with method2. But you can stay with method1 if you just do the small edit I suggested in my earlier post.

The #4 may repeat when it's still waiting for the opera interface to show up. With jbed not currently running, does it start without complaint if you just run StartOperaMini directly and not via clicking a link?


I though there was a problem as I use opera mini 3.0 french version so i replaced the "Enter Address" occurences by the french name of the window, but it seems it did not change anything.

I never thought about the localized name of the 'Enter Address' window. Unless there is a listing of all the different language version of that text, I guess users will have to manually edit that text for now.

badbob001
6th May 2008, 04:47 AM
Hi

I have all the correct JBED, MortScript and Opera Mini 4.1 installed on my MDA Compact 3.

However, when ever I run the short cut it comes up with a message

"4.1.0.5 v0.09b

Java did not run after 5 seconds

Run Setup?"

I can see that JBED does run for a second or two but then seems to close before the above message is displayed.

Any solutions.

Thanks

I'm guessing that when the script sends a leftsoftkey to open the menu and then another leftsoftkey to click 'Enter Address', the selection may move down to Exit for some reason and quit Jbed. You can try method2 if you have jbed 3.1, which uses #1 to get to the address window.

francesco85
6th May 2008, 11:12 AM
This script will create a Start Menu subfolder called midlets that will contain shortcuts to all your midlets. Give it a try:
badbob001 thanks for this script!

attached zip file fix a missing bracket.
i've modified the script to create a StartMenu\Programs subfolder that contain shortcuts.. (changed first line from SystemPath("StartMenu") to SystemPath("ProgramsMenu"))

caretaker22
6th May 2008, 11:36 AM
Hey, Bad

Could you write a script which start up flashbundle and tcpmp when surfing youtube?

badbob001
6th May 2008, 03:34 PM
badbob001 thanks for this script!

attached zip file fix a missing bracket.
i've modified the script to create a StartMenu\Programs subfolder that contain shortcuts.. (changed first line from SystemPath("StartMenu") to SystemPath("ProgramsMenu"))

Thanks for fixing that.

As for the shortcuts, the issue is that on WM Standard, shortcuts are normally in Start Menu\ while on WM Pro / Classic, it's in Start Menu\Programs\. To satisfy both devices, I could have mortscript detect which OS version it is and use Start Menu\ for WM Standard and Start Menu\Programs\ for everything else. Does anyone have any objections to that?

badbob001
6th May 2008, 05:10 PM
Could you write a script which start up flashbundle and tcpmp when surfing youtube?

From what I have read, flashbundle only works with IE or possibly other direct access browsers. Opera Mini doesn't access websites directly but go through a proxy at Opera. Isn't flashbundle automatically started / invoked when you try to view a flash video from IE?

From: http://eazyvg.linuxoss.com/2007/08/05/

You now have direct, unfettered access to Youtube, Google Video & Veoh, in all their glory. Simply install the CABs listed below, go directly to these websites, and click on a video to play. That’s it.

spangelsaregreat
6th May 2008, 07:59 PM
I'm guessing that when the script sends a leftsoftkey to open the menu and then another leftsoftkey to click 'Enter Address', the selection may move down to Exit for some reason and quit Jbed. You can try method2 if you have jbed 3.1, which uses #1 to get to the address window.

Hi,

Changed it to method2 but it does exactly the same thing.

Any more ideas?

Regards

badbob001
6th May 2008, 08:16 PM
Hi,
Changed it to method2 but it does exactly the same thing.


Did you use the selector.utf patch command? Try running jbed by itself and see if your midlets are still coming up. If not, then your selector.utf is damaged and that may be the cause of it shutting down. If my script is the cause of the damage, restore the backup in the script folder.

Another cause is if you uninstalled / reinstalled opera mini and thus you need to tell the script re-detect your new settings.

If your selector.utf is okay or untouched, then try this:

Download 0.10b_test2 from an earlier post:
http://forum.xda-developers.com/showthread.php?t=384271&page=8#71

Then use method2 and set 'Use Direct Address Input' to Yes. This way, no softkeys are pressed.

spangelsaregreat
6th May 2008, 10:51 PM
Did you use the selector.utf patch command? Try running jbed by itself and see if your midlets are still coming up. If not, then your selector.utf is damaged and that may be the cause of it shutting down. If my script is the cause of the damage, restore the backup in the script folder.

Another cause is if you uninstalled / reinstalled opera mini and thus you need to tell the script re-detect your new settings.

If your selector.utf is okay or untouched, then try this:

Download 0.10b_test2 from an earlier post:
http://forum.xda-developers.com/showthread.php?t=384271&page=8#71

Then use method2 and set 'Use Direct Address Input' to Yes. This way, no softkeys are pressed.


Nope,

That didn't work. Tried all of the above and completely reinstalling MortScript etc but it still is doing the same.

Any more ideas?

Regards

badbob001
6th May 2008, 11:01 PM
That didn't work. Tried all of the above and completely reinstalling MortScript etc but it still is doing the same.


What if you just run the script / shortcut directly instead of clicking on a link? This will show if the script can start your midlet directly.

spangelsaregreat
6th May 2008, 11:12 PM
Hi,

Tried that to but it still does the same thing. Very frustrating.

Opera still runs fine if I start up Jbed and run it from there.

Regards

badbob001
6th May 2008, 11:32 PM
Hi,

Tried that to but it still does the same thing. Very frustrating.

Opera still runs fine if I start up Jbed and run it from there.


Have you created a shortcut to directly run Opera? I'm just curious if direct-run works at all for you.

See this post:
http://forum.xda-developers.com/showthread.php?t=384271&page=9#88

Use the script to create shortcuts to your midlets. Then see if the direct-run shortcut works. If it still doesn't work, then please zip and post your selector.utf and StartOperaMini_ini.txt.

caretaker22
7th May 2008, 09:38 AM
From what I have read, flashbundle only works with IE or possibly other direct access browsers. Opera Mini doesn't access websites directly but go through a proxy at Opera. Isn't flashbundle automatically started / invoked when you try to view a flash video from IE?

From: http://eazyvg.linuxoss.com/2007/08/05/

Yes, but i love opera mini with your scripts i think its just perfect! The only thing is missing is accessing youtube video. I guess im stuck with IE when i want to watch youtube. Thanks for the reply!

spangelsaregreat
7th May 2008, 08:36 PM
Have you created a shortcut to directly run Opera? I'm just curious if direct-run works at all for you.

See this post:
http://forum.xda-developers.com/showthread.php?t=384271&page=9#88

Use the script to create shortcuts to your midlets. Then see if the direct-run shortcut works. If it still doesn't work, then please zip and post your selector.utf and StartOperaMini_ini.txt.

Hi,

That shortcut also does not work.

I have checked my Mortscript folder and it does not have a selector.utf file. It does have the other one. Is that maybe the problem?

Regards

badbob001
7th May 2008, 09:37 PM
Hi,

That shortcut also does not work.

I have checked my Mortscript folder and it does not have a selector.utf file. It does have the other one. Is that maybe the problem?

Regards

Selector.utf is a file created by your jvm as a central database of your installed midlets. It's usually in \windows\appdb\ but it may also exist in [path to your jvm]\appdb\ like "\storage card\Esmertec Java\Appdb\selector.utf".

The script first finds the location of jbed.exe from a registry setting.
Then it tries to find selector.utf from a registry setting.
Failing that, it tries [path to your jvm]\appdb\.
Failing that, it tries \windows\appdb\.

If you had installed multiple versions of jbed with multiple selector.utf files, it is possible that it assumed the wrong selector.utf.

Looking at StartOperaMini_ini.txt will show you which jbed.exe it has chosen and the parameters to run Opera. Then in selector.utf, if the suite number for opera matches the _ini.txt parameters, then direct launching opera should work.

Not sure if this is related, but you may need to 'application unlock' your device if it isn't already. It's basically a registry change but you can also use this app:
http://mobile.surrealnetworks.com/AppUnlockReg.htm

spangelsaregreat
7th May 2008, 10:12 PM
Hi,

From checking the registry the device is app unlocked.

I have attached the selector and StartOperaini files

http://rapidshare.com/files/113283552/Temp.rar.html

Regards

badbob001
7th May 2008, 10:44 PM
I have attached the selector and StartOperaini files
Regards

You have attached StartOperaMini_help.txt instead of StartOperaMini_ini.txt. It's just text so you can copy and paste the contents here if you like. If you still have the \Start Menu\Midlets\ shortcuts, you can open the 'Opera Mini 4.1' shortcut in notepad and copy and paste the contents here.

What is the full version number of the jbed you are using?

spangelsaregreat
7th May 2008, 11:32 PM
You have attached StartOperaMini_help.txt instead of StartOperaMini_ini.txt. It's just text so you can copy and paste the contents here if you like. If you still have the \Start Menu\Midlets\ shortcuts, you can open the 'Opera Mini 4.1' shortcut in notepad and copy and paste the contents here.

What is the full version number of the jbed you are using?

Hi,

The text for StartOperaMini_ini.txt is

*|4.1|\Esmertec Java\jbed.exe|-run s0_|kill_jbed(0)paste_type(shift-insert)opera_control(method2)dai_enabled(1)

I appear to have two versions of Jbed. I have version number

20070808.2.1

which is installed in the main windows directory and also version number

20080222.3.1

which is installed in the Esmertec Java directory in the root of the phone.

I can run Opera from the earlier version but it will not run using the later version (it just defaults to a blank screen with an OK soft key which when pressed takes you back to the main Java Launch screen).

So it would appear your script is running fine, it is just that the newer version of java does not want to run.

Any ideas why?

Regards

spangelsaregreat
8th May 2008, 12:31 AM
Hi

Reinstalled opera and that solved the problem.

Thanks for your assistance.

MaXTSM
8th May 2008, 08:47 PM
Are you using jbed 3.1? On my device, only jbed 3.1 worked correctly with method2. But you can stay with method1 if you just do the small edit I suggested in my earlier post.

Hello M. badbob001,
I finally got it working with the following setup :
- opera mini 3.1 english version found here : http://mini.opera.com/?rel=3
- jbed 3.1 (was using 2.1 previously)
- input method2, or method1 with the modification you mentionned

Then I had to change a few things :
- remove a bracket at line 1140 because I had a "missing bracket" error
utf_filename = "\Windows\Appdb\selector.utf")
- change opera name to support "opera mini 3" on line 120
opera40_string = "Opera Mini 3,"
- and finally change all "Enter Address" string occurences with "Enter address" !! In Opera Mini 3 the address box name has a lowercase "a" and it seems it makes the difference !

I'm in a very particular case where i can't use version 4, but if it may help other people in my case, the scipt I modified as explained above it attached here

Now i got to test a bit more with usage... Thanks a lot for your help

Menneisyys
11th May 2008, 01:49 PM
Bob, congrats - really cool! BTW, I've directly linked to this thread as well from the original and just working on an entirely updated, multi-platform tutorial on Opera Mini 4.1 invocation.

athome93
13th May 2008, 12:35 PM
There is the official 4.1 out and this script don't work with it !

http://www.operamini.com/download/

badbob001
13th May 2008, 03:41 PM
There is the official 4.1 out and this script don't work with it !

http://www.operamini.com/download/

Can you be more specific on how the script doesn't work? I looked at 4.1 and it seems to behave the same. One difference is that Direct Address Input, now known as Auto-Complete Address Input, is now disabled by default. So you should update your settings accordingly (if you deviated from the defaults).

michd43
13th May 2008, 07:42 PM
ok, I have a really bad question to ask. I want to write my own scripts but, (here it is :)) I dont know how you guys are saving the mscr. file ext. Is there an editor program or something? I tried using notepad, word, and even my xml editor. I can't figure it out. Thanks in advanced.

spangelsaregreat
13th May 2008, 10:23 PM
Hi,

It seems to work okay with the final version of OperaMini for me.

The only issue is it asking for permission to connect to the internet at each new session? How do you revert it back to automatic connection (which worked in the last beta I used)?

Regards

Zenoran
13th May 2008, 10:50 PM
Very nice!

I'm going to throw this out there as a feature request... dont flame plz! but I thought it would be cool if there was a way to update the script to switch between IE and opera...

i.e. if you have the script bound to your IE button on your phone... u click click once to start opera... then if you're browsing around and find a site that doesn't like opera mini (lots of these, specifically with forms) and you need to switch to PIE you could click the button again.. logic would be if you're in Opera/IE and it is the current focus, switch to Other app and launch same URL... if Opera/IE isn't the focus then launch/switch as it does previously...

might make for a nice option to turn on and off based on user preference

neiltoe
13th May 2008, 11:02 PM
This works just the same no need for Mortscript.

http://forum.xda-developers.com/showpost.php?p=2156987&postcount=1


As for Opera Mini 4.1 untrusted asking for permission grab a signed version there are 3 on the wap page.

http://mp-css.sidcomm.co.in/phone/Opera/Screen02.bmp
http://mp-css.sidcomm.co.in/phone/Opera/Screen03.bmp
http://mp-css.sidcomm.co.in/phone/Opera/Screen04.bmp

Feco
14th May 2008, 12:11 AM
This works just the same no need for Mortscript.

http://forum.xda-developers.com/showpost.php?p=2156987&postcount=1


As for Opera Mini 4.1 untrusted asking for permission grab a signed version there are 3 on the wap page.



Thank you so much for this mate, I was really pissed of with the mortscprit.. :D:D

Works great!

badbob001
14th May 2008, 07:18 AM
i.e. if you have the script bound to your IE button on your phone... u click click once to start opera... then if you're browsing around and find a site that doesn't like opera mini (lots of these, specifically with forms) and you need to switch to PIE you could click the button again.. logic would be if you're in Opera/IE and it is the current focus, switch to Other app and launch same URL... if Opera/IE isn't the focus then launch/switch as it does previously...


Since there is no current way to know what website opera mini is at, you can't just switch to another browser and go to the same website. If you're taking about opening an email link in opera and then pressing the IE button again to open the same link again in IE... I'm not so sure about that. What if you're using Opera Mini, switch away to run another app, and then want to switch back to Opera Mini. Naturally, you would run the shortcut / press the IE button again to switch back. It would be annoying for IE to popup instead.

I do have the 'open last link' option in Setup where you can add a url to the exclude list and then have it open in IE. In the next version, I have a separate shortcut to launch the last link in the alternative browser and if you have prompts enabled, there is a prompt option to open the last link in the alternative browser.

Zenoran
14th May 2008, 03:37 PM
Since there is no current way to know what website opera mini is at, you can't just switch to another browser and go to the same website. ....


Ahhh this would put a damper on the whole thing... I'm not too familiar with Opera Mini yet but wasn't sure if there was a way to actually copy current address to clipboard based on keystrokes.

What if you're using Opera Mini, switch away to run another app, and then want to switch back to Opera Mini. Naturally, you would run the shortcut / press the IE button again to switch back. It would be annoying for IE to popup instead.


Well, this is the part where I was saying the action would depend on whatever window is currently the focus.. Again, not familiar with Mortscript but I would imagine there is probably a way to test to see if Opera is the window in current focus???


All easily shot down anyways if there is no way to get the address from opera though... thanks :)

badbob001
14th May 2008, 07:52 PM
All easily shot down anyways if there is no way to get the address from opera though... thanks :)

Well, no one said it is impossible. We'll see...

Interesting find: Opera Mini 4.1 Final uses the midlet name 'Opera Mini', which is the same as Opera Mini 4.0. So installing Opera Mini 4.1 Final will overwrite Opera Mini 4.0. If you have Opera Mini 4.1 beta installed, Opera Mini 4.1 Final will install along side it. Can be confusing if you expected it to overwrite 4.1 beta.

badbob001
16th May 2008, 01:29 AM
Custom Commands
You can define custom commands, such as to your own scripts or other browsers, as other choices for the script to run or prompt to run. So now you can use this single script to launch all your browsers. If the app you pick can accept a url as a parameter, then you can have those commands handle the url in links.

Improved Exclude options
You can specify a different action, chosen from your list of browsers and custom commands, to handle excluded urls. If you have prompts enabled, one command is to open the last url with the exclude action, which save you from having to go into setup to perform the same step.

Prompting with timeout
As before, you can enable a prompt of action choices when running the script or opening a link. Now you can individually enable prompting when opening an excluded link. A timeout option allows you to specify how many seconds will pass before the default action or selection action is run. Both normal and exclude actions can have their own individual defaults. The timeout amount is shared by both normal and exclude actions.

Quickswitch
If enabled, running the script with Opera Mini on screen will make the script grab the current address and open it with your exclude options. If IE is on screen when invoked, the script will grab the current address and open it with your default options. This works best if the script is bound to a hardware key or some other fast launch method that quickly returns you to the previous application. So if you bind the script to your IE button and have your default action as OM and your exclude action as IE, then pressing the IE button will allow you to view the current page on the opposite browser with a single click and then vice versa...
This was a suggestion by Zenoran. Thanks!

It works fine on my WM6 smartphone, but not so great on my WM6 pda. If your default input type is not keyboard, then that may cause incompatibilities with the chosen select and copy types.

Special Commands
Setup options to create direct launch shortcuts to add your midlets as well as to the JVM itself.

Uninstall option to delete all configuration files, unregister script, and remove shortcuts.

JVM selection improvements
JVM selection depends on your registry settings and then some guesswork if needed. If your JVM registry settings are not valid or if you have multiple JVMs installed, it is possible for the wrong JVM to be automatically selected. If you run setup and do the re-detect, you have the option to manually select the JVM and the selector.utf file. So theoretically, it's possible to select a JVM other than jbed... perhaps jeodek since its direct launching works the same, but no guarantees if that will work. And after you selected your JVM files, that selection is saved so if you need to re-detect midlet changes, you have to option to use your previous JVM values.

Fixes / Notes
Encountered issues with non-english devices when I tried to look for the 'Enter Address' window, which is now fixed. Will still look for a window named Java, but you can change the text in Setup.

The _ini file has changed format, but will detect the old format and update (hopefully). Also, before writing changes to the _ini, the old _ini is renamed to _bak. If for any reason writing the new _ini fails and the _ini is lost, the script will use the _bak file upon next startup.

A debug log option writes some activity info to _debug to help troubleshoot. It's disabled by default.

On smartphones, shortcuts are created in \Windows\Start Menu\ (localized). On other devices, \Windows\Start Menu\Programs\.

Someone wanted to use Opera Mini 3.1, so that is supported now.

See the attached help file for more details.

ramontrotman
16th May 2008, 02:50 AM
congrats on a fine app sir. works like a charm.

badbob001
16th May 2008, 04:54 AM
Found some bugs with quickswitch if Use Direct Address Input is enabled. Fixed and re-uploaded.

With all this switching between opera mini, jbed 3.1's suspend problem can easily occur. One workaround is to use method2 and disable Direct Address Input in Opera Mini so the script has to just send a #1 to open the address input window.

TheETENguardian
16th May 2008, 12:22 PM
Hej i like this script a lot! works like a charm! But i notice a little side effect thats starting to annoy me now.. The internet explorer icon has been changed to the yellow mortscript icon. Is there a way to change this ? I searched the registry to change the icon but i cant find it anywhere :S
Anyone who knows how to change it back?

badbob001
16th May 2008, 06:37 PM
Added context-menu copy/paste/select options so quickswitch works on my pda. Also, copy/paste/select options can be assigned differently for OM and IE, which is important since context-menus don't work in my JVM. Also added prompt and prompt timeout options to quickswitch.

For context menus to work, it of course requires a touchscreen device and knowledge of how your context menu is structured. On my PPC, a context-menu shows:
1. Undo
2. Cut
3. Copy
4. Paste
5. Clear
6. Select All

If the location of the Copy, Paste, and Select All commands are different, run Setup and adjust their position values.

See the help file, also attached, for more info.

Hej i like this script a lot! works like a charm! But i notice a little side effect thats starting to annoy me now.. The internet explorer icon has been changed to the yellow mortscript icon. Is there a way to change this ? I searched the registry to change the icon but i cant find it anywhere :S

Most likely your shortcut content (it's just a simple text file) is:
21#:MSPIE

where :MSPIE is in a registry setting that refers to iexplore.exe.
HKLM\SOFTWARE\Microsoft\Shell\Rai\:MSPIE
1=iexplore.exe
I've modified the :MSPIE value so it refers to the script instead, which is why you're seeing a different icon.

On my WM6 device, changing the :MSPIE value does not affect the icon since the contents of the shortcut is:
21#:MSPIE?:pieapp

Where the '?:pieapp' is a shortcut feature to change the icon of a shortcut. So :pieapp refers to:
HKCR\pieapp\DefaultIcon
=shellres.dll,-8314

HKCR\pieapp\SelectIcon
=shellres.dll,-8315
So :pieapp refers to an icon stored in file shellres.dll.

I'm looking at WM6.x devices so if you have an earlier device, you may not have :pieapp.

If the above doesn't help you, try going to your device's windows folder and see if iexplore.exe shows the correct icon. If it does, then the icon should be embedded within the .exe. So if you change your shortcut to:
21#\windows\iexplore.exe
it should show the same icon for the shortcut.

Zenoran
17th May 2008, 07:41 PM
Hej i like this script a lot! works like a charm! But i notice a little side effect thats starting to annoy me now.. The internet explorer icon has been changed to the yellow mortscript icon. Is there a way to change this ? I searched the registry to change the icon but i cant find it anywhere :S
Anyone who knows how to change it back?

ya im not sure why :MSPIE was changed to run mortscript? is that necessary?

badbob001
18th May 2008, 03:20 AM
ya im not sure why :MSPIE was changed to run mortscript? is that necessary?

Perhaps it's not clear, but the ONLY purpose to register the script is so links in emails, contacts, appointments, and documents are handled by the script. If you don't care about those rare situations, just run setup and unregister the script. And even if you click on an email link and ie opens, you can just quickswitch to om.

badbob001
20th May 2008, 07:40 PM
More quickfix tweaks. Streamlined the startup code so the decision to quickswitch or not occurs more quickly. In general, starting the script should be much faster.

More commands when using quickswitch prompt so the prompt is more like a context menu allowing to perform an action with the current url or task-switch between browsers:

From the help file:
1. OPEN URL W/ AUTO-ACTION
a) determine if the currently running browser is IE or OM.
b) if OM, then it will copy the url from the current page and open it in IE.
if IE, then it will copy the url from the current page and open it in OM if OM is installed.

2. OPEN URL W/ DEFAULT ACTION
Grab the current url and run the default action. Prompt options are ignored.

3. OPEN URL W/ EXCLUDE ACTION
Grab the current url and run the exclude action. Prompt options are ignored.

4. OPEN URL W/ ACTION PROMPT
Grab the current url and show the actions prompt. This is useful for sending the url to a custom command, like bookmarks.mscr.

5. LAUNCH DEFAULT ACTION
Just launch the default action. Prompt options are ignored.

6. LAUNCH EXCLUDE ACTION
Just launch the exclude action. Prompt options are ignored.

7. LAUNCH ACTION PROMPT
Just show the actions prompt.

8. KILL THIS BROWSER
Kill the current browser. Useful for killing IE or closing a stuck JVM.

9. SHOW <OTHER BROWSER THAT IS RUNNING>
If you have both IE and OM running, this will allow you to quickly switch to the other browser. May be useful for multitasking two browser settings such as viewing something in OM and downloading something in IE.

10. RUN SETUP

Also added a sample bookmarks.mscr script that you can add to your list of commands and use with quickswitch prompt to have a unified bookmark list between IE and OM. Gives you an idea of all the fun stuff you can do once you have the ability to grab the url from the current browser.

Since it's not absolutely necessary to update the registry or add start menu shortcuts to 'Start Opera Mini', I've removed those automatic options on new installs.

Added a 'Add filename to param' button in the commands editor so it's easier to choose a mortscript file when defining a new command. Practice with the included bookmarks.mscr file.

Not sure if anyone has noticed, but the items in many prompt screens are now numbered so you can get to a particular item faster by pressing a number. Good when paired with the prompt timeout feature. On my wm standard device, I have to hold down a keypad number for the script to register the key press. May not work on all device types.

Added before but not mentioned: added a mortscript version check to make sure you have mortscript 4.1 or higher. Good against other scripts that include an outdated version of mortscript as part of the install.

As always, view the help file for more details.

badbob001
21st May 2008, 05:45 PM
Added TO DO / KNOWN BUGS: to the first post.

tmknight
21st May 2008, 06:40 PM
Keep up the good work!

Just a comment, not a complaint, but some of the dialogues are a long and do not display properly on square displays (e.g. Treo 750).

In the attachment I believe the OK button at the bottom is obscured - of course since it's just OK, easily worked around. I don't remember the dialogue that I first noticed this, but it had a yes/no that was mostly obscured.

Like I said, just an FYI.

Cheers!

badbob001
21st May 2008, 06:59 PM
Just a comment, not a complaint, but some of the dialogues are a long and do not display properly on square displays (e.g. Treo 750).

This seems to only happen on touchscreen devices. On smartphones, all windows are fullscreen and have scrollbars. On other devices, dialog windows are sometimes windowed with no scrollbars. The lack of scrollbars can be annoying if you want to display a lot of text (check out the About / Help). This is really a quirk with Mortscript and I'm not sure if there is anything I can do about it. The alternative is to save the text to a file and have Word open it (yuck).

TheETENguardian
23rd May 2008, 03:34 PM
......


Most likely your shortcut content (it's just a simple text file) is:
21#:MSPIE

where :MSPIE is in a registry setting that refers to iexplore.exe.
HKLM\SOFTWARE\Microsoft\Shell\Rai\:MSPIE
1=iexplore.exe
I've modified the :MSPIE value so it refers to the script instead, which is why you're seeing a different icon.

On my WM6 device, changing the :MSPIE value does not affect the icon since the contents of the shortcut is:
21#:MSPIE?:pieapp

Where the '?:pieapp' is a shortcut feature to change the icon of a shortcut. So :pieapp refers to:
HKCR\pieapp\DefaultIcon
=shellres.dll,-8314

HKCR\pieapp\SelectIcon
=shellres.dll,-8315
So :pieapp refers to an icon stored in file shellres.dll.

I'm looking at WM6.x devices so if you have an earlier device, you may not have :pieapp.

If the above doesn't help you, try going to your device's windows folder and see if iexplore.exe shows the correct icon. If it does, then the icon should be embedded within the .exe. So if you change your shortcut to:
21#\windows\iexplore.exe
it should show the same icon for the shortcut.


I have adjusted that shell\rai\internet explorer key back to 1=iexplore.exe and that did the trick .. that pieapp thingie you mentioned i didn't understand but at least i changed that first key and everything still works hehehe... so thank you

strikeone
29th May 2008, 12:15 AM
I just want to thank badbob001 again for the creation & development of this script. Thanks!

ems275
29th May 2008, 08:32 AM
By the Way this script is great!

Is there any way to adapt it to also add Skyfire to the Browser Choice List?

I tried to do it myself but without any luck. I could not find any reg Entries for Skyfire, except one for Install Location under HKLM\Software\Apps\Skyfire browser. But that is it. the Reg entry points to where it is installed.

This addition would be greatly beneficial. :)

Thanks in Advance.

del4
30th May 2008, 02:57 AM
Thanks badbob001 for this awesome script. Had nearly run out of time with the 30-day trial of Opera Mobile, so I was checking out other options when I came across this which makes Opera Mini a more-than-worthy alternative! Only thing I really miss is tabs, but I'm sure that'll show up in a release somewhere down the line...

In my attempts to customize the script for my personal preferences, I tried to edit the script to do this myself, but obviously missed something, because it isn't working...:o I'm trying to have the script check the screen orientation and if it's in portrait mode, automatically switch to landscape view, launch Opera Mini as it does now, then switch back to portrait mode.

Could someone help me with this?

Might also be an option that could be incorporated into the Settings part of the script for use by others???

TIA

badbob001
31st May 2008, 01:15 AM
By the Way this script is great!

Is there any way to adapt it to also add Skyfire to the Browser Choice List?

I tried to do it myself but without any luck. I could not find any reg Entries for Skyfire, except one for Install Location under HKLM\Software\Apps\Skyfire browser. But that is it. the Reg entry points to where it is installed.

This addition would be greatly beneficial. :)

Thanks in Advance.

In Setup > Command List, I tried adding skyfire.exe, which in located in \Program Files\Skyfire\ and used the [Test] button to run:
\Program Files\Skyfire\skyfire.exe http://google.com
While skyfire launched, it did not go to google.com. So either it doesn't take a url as a parameter or parameters need a specific format.

badbob001
31st May 2008, 01:27 AM
In my attempts to customize the script for my personal preferences, I tried to edit the script to do this myself, but obviously missed something, because it isn't working...:o I'm trying to have the script check the screen orientation and if it's in portrait mode, automatically switch to landscape view, launch Opera Mini as it does now, then switch back to portrait mode.

I would create another script that would:
1. Check device orientation using screen(type)
2. Rotate screen using rotate(orientation)
3. Run StartOperaMini script
4. Wait a bit for my script to run.
5. In a loop, check to see if jbed.exe is running.
6. If jbed.exe stops running, change the orientation back and edit the loop.

rebecker
9th June 2008, 05:46 PM
OK, I'm an idiot!

I thought that in addition to making Opera Mini my default browser (which works great!) I'd be free of those annoying permission messages at startup. Did I miss something, or do I have to install something else to kill those messages?

My apologies to those annoyed with old questions, but time is money ;)

badbob001
9th June 2008, 06:05 PM
I thought that in addition to making Opera Mini my default browser (which works great!) I'd be free of those annoying permission messages at startup. Did I miss something, or do I have to install something else to kill those messages?


Either install the signed version of Opera Mini 4.1 Final (instructions here: http://forum.xda-developers.com/showpost.php?p=2106476&postcount=2)

or

Hack your selector.utf file:
Run 'Start Opera Mini Setup' > Special Commands > Patch Selector.utf

rebecker
9th June 2008, 09:45 PM
Either install the signed version of Opera Mini 4.1 Final (instructions here: http://forum.xda-developers.com/showpost.php?p=2106476&postcount=2)

or

Hack your selector.utf file:
Run 'Start Opera Mini Setup' > Special Commands > Patch Selector.utf
Thank you VERY MUCH! It works! :D

dbh369
16th June 2008, 07:46 PM
This works great! Thanks for the very smooth install too. Thanks much to you and Menneisyys and JZ SmartMort

badbob001
16th June 2008, 09:48 PM
Faster startup
Biggest hurdle with this release was trying to reduce the startup time of the script. I've taken multiple steps, such as breaking the script to sub scripts (stored in the \sub\ folder) so less initial time is taken for loading the script file.

I've also changed the way settings are stored and loaded, so the _ini.txt file is gone. Instead, settings are stored in a script in the sub folder.

Keeping compatibility with the settings of earlier versions was always a concern, but the code to check for old versions was slowing down the startup, so I've decided to break compatibility. So installing this version over a previous version, the script will need to re-detect your JVM parameters, re-detect Opera Mini browsers, and redo your settings.


Better OM control
Fine tuned opera control methods and renamed them so the name describes what they do. So method1 is "leftsoftkey" and method2 is "shift3-one". The new addition is "f9-one", a tiny tweak of "shift-3-one", which works in jbed 2.1.

With the smartphone screen bug of jbed 3.1, I now recommend jbed 2.1 for everyone and have made "f9-one" the default control method. Since "f9-one" allows Opera Mini to be controlled when it's not on the Start Page and when in full screen, I've also changed "Kill JVM first" to default to 'No'.


Select, Copy, Paste
The Select, Copy, and Paste functions used for launching an opera mini url and quickswitching is now exposed for general usage. You can access these commands. All copied and pasted text is stored in the same file used to store link histories for easy retrieval.

To make these commands more quickly accessible, I've created the HotKey feature (see below).


HotKey
Excert from help file:

Hotkey is a special shortcut where a different command is run depending on how many times you run it within a short period of time. It's like a computer mouse, where you can single click, double-click, triple-click... This feature works best when bound to a hardware button.

The default setting is:
One click: start the script normally
Two clicks: start the script with the prompt menu
Three clicks: show the copy/paste clipboard menu
Four clicks: run setup

To make it easier to see what action will run and to confirm that your 'click' was recognized, a status is briefly displayed and updated after each key press.

For example, one click will show:
> Normal
Prompt
ClipMenu
Setup

The '>" cursor shows the action to run if no further clicks are detected.

But if another click is sent, the display then shows:
Normal
> Prompt
ClipMenu
Setup

And so on. It is possible to wrap the cursor around. For example, if you click four times, the cursor will be at 'Setup'. Click it immediately again and it will go to 'Normal'.

Mortscript doesn't allow two or more instances of a script to run at the same time nor does it support detecting key presses, so getting this Hotkey feature to work required some trickery in the background with multiple sub-scripts. How responsive Hotkey is greatly depends on the speed of your device. So if your device is not very fast, then you may need to pause a little bit between clicks.

Once you have the pacing done, you can launch the hotkey action you want without even looking.


* DISPLAY DURATION (seconds)
How many seconds to show the status display. Once the status display times out after the specified number of seconds, the selected action will run. You may want to increase this if your device is particularly slow or decrease this on a fast device so actions occur sooner.

* EXTRA DELAY (milliseconds)
After the display times out, you can add an option delay afterwards before the selected action is run. This will give you more time to send another click and change the selected action to run.

* HOTKEYMENU TIMEOUT (seconds)
When you customize each of the four hotkey action slots, you can choose an action called 'HotKeyMenu', which shows a prompt of all available HotKey actions, which is good if normally access more than four hotkey actions. The timeout feature is the number of seconds the hotkey menu will be displayed before the selected action is run. Unlike other prompts, no default action is pre-selected.

* HOTKEY1, HOTKEY2, HOTKEY3, HOTKEY4
Select the action you want to assign to each hotkey slot.

------------------------------------------
- Normal
Start the script normally.

- Prompt
Start the script with the prompt.

- ClipMenu
Show the copy/paste menu. This is the same as the copy/paste menu in the prompt menu. Here, you can update your default copy/paste methods and other options.

- SelectCopy
Select and copy text based on select and copy methods in ClipMenu. Copied text is sent to the clipboard as well as the clip/url file.

- SelectChoiceCopy
Same as SelectCopy but you are prompted to choose what selection method to use. This is useful since you can choose to select all text or just the current line or just the previous word. Copied text is sent to the clipboard as well as the clip/url file.

- Paste
Paste url if available, otherwise paste text from clipboard. Copied text is sent to the clipboard as well as the clip/url file.

- PasetChoice
Bring up the clip/url list for you to select what text to paste. Copied text is sent to the clipboard as well as the clip/url file.

- Select
Select text based on the select method in ClipMenu.

- SelectChoice
Same as Select but you are prompted to choose what selection method to use.

- Copy
Copy selected text based on the copy method in ClipMenu. Copied text is sent to the clipboard as well as the clip/url file.

- ClearCB
Clear the contents of the clipboard.

- StopScript
Will stop all mortscript processes.

- ShowScript
Will attempt to make the StartOperaMini script visible, which is useful if the script becomes minimized or if another application becomes the active visible application.

- Kill
Kill the currently visible application. Be careful if you invoke this on your homescreen and kill your homescreen plug-in, which then may require a reboot to fix.

- LinkChoice
Bring up a list of items for the clip/url list to send to the script as a url.

- Setup
Run setup.

- *CUSTOM*
Select a browser or command to run. You can add any commands to the command list and then be able to select that command here.

- Nothing
Runs nothing. You can assign this to the first hotkey slot so that actions require at least two clicks, which reduces accidental launching by pocket gremlins.
------------------------------------------

* UPDATE SHORTCUT
To help reduce the need to manually recover the hotkey shortcut after every change, use this to select an existing shortcut (.lnk) to overwrite with the contents of the hotkey shortcut. Note that if the target shortcut is readonly or a rom file, it may not update correctly. You may then need something like Resco Explorer to force an overwrite.


--------------------
<?> HOTKEY NOTES:
--------------------
If you don't want to see the display since you already got the clicking pacing down, you can change the Display duration from 2 seconds to 0 and then change Extra Delay from 0 to 2000 milliseconds.

If you don't care for hotkeys but don't want to re-assign your hardware buttons to point back to StartOperaMini shortcut, you can assign the first hotkey to 'Normal' and set Display Duration to 0 and Extra Delay to 0 so the first hotkey is run immediately. If you do the same thing but assign the first hotkey to HotKeyMenu instead, then the hotkey menu will open immediately.


The HotKey shortcut has its own icon so you will need to update the OperaIcon.dll file by renaming the original and copying over the new one. Also check the help file on some tips on mapping the hotkey shortcut to hardware buttons.


Fixes
And many other fixes, such as:
If you accidentally switch away from a script dialog, it will switch back in a bit.
Long messages now can be completely viewed on touchscreen devices.

aRGybaRGy
16th June 2008, 11:14 PM
Hmmm...

With this new version, it looks like I've lost the ability to click on a URL in flexmail and get it to open in OM now, or have I missed an important config step?

Ta
G

badbob001
16th June 2008, 11:47 PM
With this new version, it looks like I've lost the ability to click on a URL in flexmail and get it to open in OM now, or have I missed an important config step?


I can only think you did this:
1) installed the new version in a different location than the old version.
2) ran the new version and answered No to the 'register script' question.

1) is easy to happen since I now put the zip contents in a subfolder called StartOperaMini.

2) since this version no longer reads the settings of old versions, you would have been asked some initial questions, such as if you wish to register the script so it works with links in emails, documents, etc. If you answered no to the question and in conjunction with 1), your registry is still pointing to the old script files. And if you deleted the old files, then the registry settings would cause nothing to happen.

So just run Setup > Special Commmands > Registry Script. Make sure when you when Setup, it shows "0.11b" in the window title to indicate that you are running the new version and not the old version.

JonDeutsch
16th June 2008, 11:54 PM
Hi,

I've installed and configured the latest version (11b) but when I get into OM4.1, I see the wwww's get removed one by one, but the destination URL (picked up from a link in WM's mail application) is not getting pasted into the URL field.

So the process fails. It really does seem like it needs vito's cut and paste and that that piece is missing. But, nowhere does it say that this cut'n'paste app is required... plus I already have it installed!

Any ideas?
Thanks,
Jon

badbob001
17th June 2008, 05:26 AM
Hi,

I've installed and configured the latest version (11b) but when I get into OM4.1, I see the wwww's get removed one by one, but the destination URL (picked up from a link in WM's mail application) is not getting pasted into the URL field.

So the process fails. It really does seem like it needs vito's cut and paste and that that piece is missing. But, nowhere does it say that this cut'n'paste app is required... plus I already have it installed!


Vito cut and paste is not required. I'm assuming this is your first experience with my script. What device are you using?

I'm also assuming you didn't change any setting in setup, like
Setup > Use Auto-Comp Address Input. Setting this to Yes is usually a bad idea since you can't paste text into Opera Mini's auto-complete field. The following should make it clear:

http://forum.xda-developers.com/attachment.php?attachmentid=93212&d=1213672910 http://forum.xda-developers.com/attachment.php?attachmentid=93213&d=1213672910

Were there any error messages?

You may want to run Setup > Main Options > OM Paste Type and see control-v works.

badbob001
17th June 2008, 04:03 PM
Found some issues with the script initializing the correct settings for new users. Corrected and re-uploaded, so please re-download.

badbob001
17th June 2008, 08:47 PM
Noticed that quickswitch was grabbing the previous OM url instead of the current one. Fixed and re-uploaded. Interesting how fixing or tweaking one thing will break a previous working and unrelated thing.

JonDeutsch
18th June 2008, 08:17 PM
Hi,

First, thanks so much for the quick and thorough response to my question. Allow me to further explain...

I am using a WM6 HTC S710 (VOX) SmartPhone. I do have Vito Cut'n'paste installed, but clearly that should not matter.

My use case is:

I'm in the WM email app, looking at an HTML email from Tech Crunch, and clicking on a hyperlink. It opens OM4.1 as expected, and I see it manually erase the "www" prefix. And then it pauses, briefly goes back to the OM4.1 start page, and then goes back to the URL entry window where I just was, with the "www." prefix back in place. Then the script ends.

I've gone into the settings and tried changing the paste approach to "type" and control-v to no avail.

Autocomplete is set to off. There are no error messages. The URL is passed correctly when I choose IE as my default browser.

Hope this helps... thanks,
Jon

Vito cut and paste is not required. I'm assuming this is your first experience with my script. What device are you using?

I'm also assuming you didn't change any setting in setup, like
Setup > Use Auto-Comp Address Input. Setting this to Yes is usually a bad idea since you can't paste text into Opera Mini's auto-complete field. The following should make it clear:

Were there any error messages?

You may want to run Setup > Main Options > OM Paste Type and see control-v works.

badbob001
20th June 2008, 12:07 AM
I am using a WM6 HTC S710 (VOX) SmartPhone. I do have Vito Cut'n'paste installed, but clearly that should not matter.


Firstly, please re-download the script as I think you have an earlier release of 0.11b and I since re-uploaded updated versions of it twice.

Your S710/Vox has been experienced by others as having problems with mortscript for pasting text. Does vito allow you to paste text into the Opera Mini address window, where the address window is what you get if you click the Opera Mini address field, press right, press up, and click on Insert Symbol.

If you want, you can experiment with the text pasting feature of my script to see if you can somehow manually get text into the Opera Mini address window. Perhaps all that is needed is an extra click to get the window into focus.

Another user with a Pantech Duo device has the same issue and the solution was:

Script settings:
Paste Type: type-then-delete
Use Auto-Comp Address Input: Yes

In Opera Mini:
'Auto-complete address input' needs to be checked.

Now the url is not pasted into a separate input window but directly typed into the address field on the Opera Mini interface. If the url is long, it can take a while, especially with mortscript's double-character bug and the need to go back and delete the duplicates.

One experiment was to send the long url to tinyurl.com to get a shorter url before typing the url into Opera Mini, but that may be overkill for this issue.

Let me know how it goes.

JonDeutsch
24th June 2008, 08:43 PM
badbob001,

Thanks for the great on-line support for your script!

Your diagnosis was corret - my vito cut'n'paste would not paste content into the text entry UI, so neither would MortScript. Interesting problem... does it really only affect a few Vox-like phones? That seems odd.

Anyway, your configuration advice actually (sort of) worked! The settings to make the "typing" happen within the browser (and not the text entry UI) did enable it to work, but like you said, the double-character bug is really painful and slow to watch unfold.

Worse, there is another problem that stops it from working on my phone: the initial "www" is not removed when doing the typing in the address field itself. So, when it's done adding and removing all that text, I still end up with a page not found because all my addresses start with wwwhttp://etc...

I think the tinyURL solution would be a very savvy way to reduce the almost-comical type/delete routine some of us have to go through to make this work!

Or... is there a setting in JBed to enable the paste to work in the data entry screen?

Thanks again,
Jon

badbob001
24th June 2008, 11:19 PM
Worse, there is another problem that stops it from working on my phone: the initial "www" is not removed when doing the typing in the address field itself. So, when it's done adding and removing all that text, I still end up with a page not found because all my addresses start with wwwhttp://etc...

You found a bug! Oops.

I'll fix that bug and post an alpha version that allows you to pre-process the url through tinyurl first.

What version of jbed are you using? I use CloudyFa Jbed 2.1 and it can be downloaded here:
http://www.modaco.com/index.php?act=attach&type=post&id=23899

Jbed itself doesn't block pasting as it works on many other phones, but perhaps it's more complicated than that since on touch-screen devices, you can't open a context menu within jbed to access copy/paste options.

I'm thinking it's a problem with some phones with slide-out keyboards...

badbob001
25th June 2008, 08:26 PM
Anyway, your configuration advice actually (sort of) worked! The settings to make the "typing" happen within the browser (and not the text entry UI) did enable it to work, but like you said, the double-character bug is really painful and slow to watch unfold.


Jon,

Try this alpha build. Install it over your existing installation. Run Setup > Advance Options.

At the bottom of the list, you'll see two new options:
Run PRE script
Run POST script

PRE and POST refer to \sub\pre.mscr and \sub\post.mscr scripts and is where users can put in their own commands to perform custom actions.

Pre.mscr runs right before the browser is run and Post.mscr is run near the end of the main script.

In Pre.mscr, I put in a subroutine to query tinyurl.com to get the short name of the url. So in your case, change 'Run PRE script' from No to Yes, which simply renames \sub\pre.mscr_ to \sub\pre.mscr and vice versa. As before, you still need to have 'Use Auto-Comp input' set to Yes and paste method = type-then-delete.

My phone connects to the Internet via a carrier proxy server so I had to add some extra code in pre.mscr to get that to work. If there is any issues with the script connecting to the Internet, you may need to comment out some lines in pre.mscr.

One quirk with typing directly into the opera mini interface (not the insert symbol window) is that typing a number may not result in a number being entered but the T9 letter for that number. For example, typing ABC123 may show up as ABC.AD (1 = ., 2 = A, 3 = D). My phone doesn't have a keyboard so perhaps on your phone with a keyboard, it will be different or may require you to have the keyboard opened first. So if the retrieved tinyurl is typed with less than 6 characters, you end up at the wrong page, or the tinyurl website tells you the url was not found, then most likely this issue has occurred.

Other uses for PRE and POST:
* Rotate the screen to landscape before running opera mini and return to portrait after jbed is closed. I already have that code in the two script files so you just need to uncomment '#call("rotate_opera")' in pre.mscr and uncomment '#call("unrotate_opera")' in post.mscr. Someone asked for this feature. It's pretty useless for me since my device was not designed for landscape and so the dpad orientation doesn't rotate to match the screen.

* Connect / Disconnect from the Internet. While I don't have the code for this in place, it should be easy for someone to do and you can use the rotate code to model the start and end behavior. Someone asked for this.

* Whatever you want!

[alpha1 removed]

JonDeutsch
25th June 2008, 11:58 PM
Thanks for the quick turn-around and the updated alpha.

What you predicted is exactly what happened: The TinyURL failed. Funny thing is, though, is that I do not have t9 set to ON on my phone... I do need to press-and-hold the numeric keypad to get a digit, though. I'm guessing that's what your talking about.

And, while the TinyURL pre-routine is very slick, the time it takes for my non-3G phone to do its business might be almost as (if not more) time-consuming as the type/delete routine.

But... you did fix the problem of not erasing the www in the browser, which is great.

One last thing I want to report is after all the typing and deleting is done, there seems to be an extended pause before the "action/enter" button is clicked in the script. Meaning, the URL is fine and trimmed, but it sits there for at least 10-15 seconds until MortScript clicks "go" to start the loading process. Is this a setting that can be set?

Thanks!
Jon

badbob001
27th June 2008, 07:52 PM
What you predicted is exactly what happened: The TinyURL failed. Funny thing is, though, is that I do not have t9 set to ON on my phone... I do need to press-and-hold the numeric keypad to get a digit, though. I'm guessing that's what your talking about.

This second alpha has three new type methods that may help:
* TYPE-THEN-DELETE_T9NUM
Type the whole url without numbers and afterwards goes back to delete duplicate characters and to use T9 to put back the numbers. This fixes the issue where on some devices, typing a number doesn't produce a number but instead invokes T9 input, eg: 1 = ., 2 = a, 3 = d, etc.

* TYPE-THEN-DELETE_T9ALPHA
Type 0-9, a-z, and A-Z using a method that doesn't produce duplicates. For all other characters, the normal method is used and the duplicates are deleted.

* TYPE-THEN-DELETE_T9ALPHA+
Same as TYPE-THEN-DELETE_T9ALPHA but uses alternate methods to enter characters #, *, +, -, ., and /. May not work on non-phone devices.

See which is faster for you. TYPE-THEN-DELETE_T9NUM seems faster. It also speeds things up to change Setup > Advance > 'Delay between keys' from 100 to 50.

I think making the script do true T9 input (with multi-taps for each character) would be too error-prone and phone specific.

Note that after upgrading to the new files, you need to run Setup to re-enable the PRE or POST scripts if you had them enabled before.


And, while the TinyURL pre-routine is very slick, the time it takes for my non-3G phone to do its business might be almost as (if not more) time-consuming as the type/delete routine.

It usually takes my EDGE phone only a couple of seconds to get the tinyurl, though it may take longer if your device needs to initiate a GPRS/EDGE connection first (no G or E above the signal bars).

You should look at pre.mscr and see if commenting out the following two lines helps:
Connect("The Internet")
and
CloseConnection
If commenting out those lines causes the resulting url to not become a tinyurl, then mortscript needs the above lines to connect to the internet.

Attached is a test script (tinyurl_test.mscr). It will attempt to connect to get the tinyurl of google.com, microsoft.com, and yahoo.com and then again but with internet initialization first. The number of seconds for each connection is then shown afterwards. Connecting without an existing gprs/edge connection takes me about 5 to 10 seconds while the subsequent connections only take 2 -4 seconds.


One last thing I want to report is after all the typing and deleting is done, there seems to be an extended pause before the "action/enter" button is clicked in the script. Meaning, the URL is fine and trimmed, but it sits there for at least 10-15 seconds until MortScript clicks "go" to start the loading process. Is this a setting that can be set?

Normally, action/enter is hit less than a second after the url is inserted. The only time there is an extended wait is if you're running an unsigned version of Opera Mini or unpatched JVM, so permission messages pop up and the script is waiting for you to answer them. I have reworked some of the related code in alpha2 so perhaps it's faster for you now.

Also, sometimes the script correctly sends the action/enter but Opera Mini visually doesn't show a response. But if you try to manually press action/enter or any other key, Opera Mini is still not responsive. I assume this is an Opera Mini quirk and you just need to be patient. But the wait is usually a few seconds and not 10-15.

Also, perhaps your device is slowed down with other processes or is running with little free ram.

Hope that helps.

aRGybaRGy
4th July 2008, 02:57 PM
I can only think you did this:
1) installed the new version in a different location than the old version.
2) ran the new version and answered No to the 'register script' question.

1) is easy to happen since I now put the zip contents in a subfolder called StartOperaMini.

2) since this version no longer reads the settings of old versions, you would have been asked some initial questions, such as if you wish to register the script so it works with links in emails, documents, etc. If you answered no to the question and in conjunction with 1), your registry is still pointing to the old script files. And if you deleted the old files, then the registry settings would cause nothing to happen.

So just run Setup > Special Commmands > Registry Script. Make sure when you when Setup, it shows "0.11b" in the window title to indicate that you are running the new version and not the old version.

Aaah.. looks like there's a limit to the number of characters to the path of the script - I've reduced the number now and it works again. :)

Cheers
RG

badbob001
4th July 2008, 03:56 PM
Aaah.. looks like there's a limit to the number of characters to the path of the script - I've reduced the number now and it works again. :)

I suspect there is a rough 256 character limit to command paths in windows mobile. If I create a shortcut with more than 256 characters, the latter part of the shortcut, which usually is a reference to the shortcut icon, gets ignored.

bones20
19th July 2008, 11:24 PM
EDIT: I was able to resolve the below. The problem was due to long path to the script in the storage card. I moved the script right under the storage card and it works now.

Dear BadBob,
Thanks for this useful utility. I was able to use all the features of your program like:
- create shortcut
- patch UTF selector
- make default

However, while opera does launch fine as a default browser from the outlook message links, it does not do so from google search today plugin and also not from the SPB diary today plugin. I get messages like this:
"there is no application associated with "http://blah blah". Run the application first, then open this file from within the application."

Please suggest. I tried everywhich way to tweak your settings but it just doesnt work as default browser from these apps. If i unregister your script, then IE gets launched fine as a default browser from these apps.

thanks,
Rajeev

sunsetdk
28th July 2008, 10:50 AM
badbob001,
Your diagnosis was corret - my vito cut'n'paste would not paste content into the text entry UI, so neither would MortScript. Interesting problem... does it really only affect a few Vox-like phones? That seems odd.


I have a S710 too

SmartTools will perform a paste into the address window. I have mapped the "clipboard" to "enter key for 2 sec" and then a 3. This will paste the clipbard contens into the window. My problem is now just how to make mortscript perform the action.

mrbelvedere
29th July 2008, 01:39 AM
I installed this program & for a while it was working fine. Now everytime I click on a link in an email, it INSTALLS Opera Mini instead of opening it & times out before it finishes installing. Can any of you gurus help me figure this out? I used the Jbed & Opera Mini CAB found here (http://forum.xda-developers.com/showthread.php?t=398567&highlight=set+opera+mini+default) and I have 0.11b running as well. Any help is appreciated!

rebecker
30th July 2008, 03:31 AM
I installed this program & for a while it was working fine. Now everytime I click on a link in an email, it INSTALLS Opera Mini instead of opening it & times out before it finishes installing. Can any of you gurus help me figure this out? I used the Jbed & Opera Mini CAB found here (http://forum.xda-developers.com/showthread.php?t=398567&highlight=set+opera+mini+default) and I have 0.11b running as well. Any help is appreciated!
Reinstall from the Opera Mini site and NEVER close Mini in any way other than the application Menu/Exit command. There's a bug in OM that is triggered by closing it in a way other than the OM Exit command.

-Bob-

mrbelvedere
31st July 2008, 04:19 AM
I will give it a shot & report back.

fldash
31st July 2008, 04:41 PM
Hi guys, just installed this on my HTC Touch CDMA. It acts like its going to work, but fails at some point.

A) It loads Opera.
B) Opens up the address input bar.
C) Deletes the text there
D) Seems to do some sort of application switch.
E) Returns to opera but the only thing in my location is www.

StartOperaMini_last has the correct URL in it.

Any ideas?

Edit: In addition, I manually started opera, clicked on the box to pop-up 'Enter Address' brough up the keyboard and hit 'Ctrl-V' and it pasted the correct URL into the box...

ie_paste_type = shift-insert
ie_select_type = select-all
ie_copy_type = ctrl-insert

om_paste_type = shift-insert
om_select_type = select-all
om_copy_type = ctrl-insert

Alkemist
7th August 2008, 10:40 PM
Script installed.

When it attempts to launch OM, the OM homescreen continuously seems to shift from side to side. Whenever I move to a lower field, it returns it to the first one. I have to kill OM.

Any ideas as to why this is happening and how it can be fixed?

PS
I'm using jeodek.exe instead of jbed.

Mikey
25th August 2008, 03:19 AM
Hi,

I've installed and configured the latest version (11b) but when I get into OM4.1, I see the wwww's get removed one by one, but the destination URL (picked up from a link in WM's mail application) is not getting pasted into the URL field.

So the process fails. It really does seem like it needs vito's cut and paste and that that piece is missing. But, nowhere does it say that this cut'n'paste app is required... plus I already have it installed!

Any ideas?
Thanks,
Jon

I'm having the same issue: 0.10bSP3_StartOperaMini

Excalibur with 6.1
Mortscript saved to memory
ran setup only and changed nothing else.

JZ SmartMort
27th August 2008, 06:50 AM
Hi,

I've installed and configured the latest version (11b) but when I get into OM4.1, I see the wwww's get removed one by one, but the destination URL (picked up from a link in WM's mail application) is not getting pasted into the URL field.

So the process fails. It really does seem like it needs vito's cut and paste and that that piece is missing. But, nowhere does it say that this cut'n'paste app is required... plus I already have it installed!

Any ideas?
Thanks,
Jon

I'm having the same issue: 0.10bSP3_StartOperaMini

Excalibur with 6.1
Mortscript saved to memory
ran setup only and changed nothing else.
Vito CopyPaste does not work in OM4.1 (actually JBed). You are not allowed to press-hold the action button in JBed so that's a limitation.

Rob Tesnear
26th September 2008, 03:34 AM
Good info in this thread for me anyway. Thanks all.

rebecker
10th October 2008, 03:45 PM
I tried Skyfire yesterday (for about 2 seconds. Couldn't get pass the password nonsense) and now OM is not the default browser. Tried running the script again, but nada. Can someone step me through the setup (or settings) to get OM back as my default browser?

Edit: Please, I've run the re-detect but still cannot get OM to work as my default browser. Here are my results:

Browser re-detect complete:
- ACTIONS ----
[Browsers (1)]
1. OM 4.x (d)(last)

[Commands (2)]
2. tinyurl.com
3. del.icio.us (d)

[Other (1)]
4. [IE] (e)

(d)=default (e)=exclude

What am I doing wrong????????????????

Thanks.

-Bob-

SH4YD33
19th November 2008, 09:19 PM
Looks like we need an update for the 4.2 Opera mini..

flaviopac
23rd November 2008, 08:28 PM
When I launch OperaMini, what new functions I have and how to launch them?

creed
16th December 2008, 05:04 PM
How do I get quickswitch to open the current page I am viewing in Opera mini in Internet explorer? I manage to get internet explorer to open but it just goes straight to the home page. I am not sure I am invoking quickswitch correctly. With the page open on Opera mini I run the script. Then a prompt comes up asking which browser I wish to use. I choose internet explorer.

These is my current setup:

- ACTIONS ---------
[Browsers (1)]
1. OM 4.x (d)(last)

[Commands (0)]

[Other (1)]
2. [IE] (e)

(d)=default (e)=exclude

- SETTINGS --------
Settings found: 38
format="3"
kill_jbed="0"
opera_control="f9-one"
dai_enabled="0"
prompt_timeout="2"
action_prompt="0"
exclude_prompt="0"
action_default="1"
exclude_default="OM 4.x(1)"
last_ver="OM 4.x"
wait_time_between_keys="100"
wait_time_for_java="5"
wait_time_for_opera_notrunning="5"
wait_time_for_opera_running="3"
wait_time_for_address="3"
trim_length="1"
jvm_file="\Windows\jbed.exe"
selector_file="\Windows\appdb\selector.utf"
jvm_title="Java"
debug="0"
quickswitch_enabled="1"
ie_paste_type="shift-insert"
ie_select_type="select-all"
ie_copy_type="ctrl-insert"
hide_messages="0"
ie_address="2"
qs_delay="0"
qs_timeout="2"
qs_prompt="0"
copy_position="3"
paste_position="4"
select_position="6"
om_paste_type="context-menu"
om_select_type="select-all"
om_copy_type="context-menu"
hkcopy="none"
cbsize="20"

UPDATE*
Quick switch just suddenly started working for no apparent reason! WTF??

bloodflower73
12th January 2009, 09:56 AM
Hi guys,
I have installed this script but when I read news with RssHub I can't open the link for read more because show me this message: "There is no applications associated with http://www......"
I've installed Jbed 2.1, Opera mini 4.1 and Mortscript 4.1.
My phone is Htc Diamond with cooked rom Dib 1.9.

Thank for your help!

B

estelleessex
19th March 2009, 08:54 PM
I am desperately trying to make MiniOpera my default browser and make it work when I click a link in an email message; I have read your postings, but I am not that technical and I don't know what to do with the zip file. I emailed it to myself on my Blackberry but then I'm lost.

Could you email me Estelle.Essex@ottawacatholicschools.ca on how to do it.
e

sancho1234
16th September 2009, 09:33 PM
When will you create Opera Mini 5 beta support? :)

JZ SmartMort
17th September 2009, 12:12 AM
When will you create Opera Mini 5 beta support? :)
As you can see there have not been any updates in over a year. Go to the first post and read the top you will find this:


10/20/2008: You may or may not notice that I haven't updated the script in a while. I had lost my windows mobile phone (t-mobile shadow) many months ago and I guess that killed my enthusiasm and any practical way to do testing (process detection doesn't work very well on the emulator). It also doesn't help that mortscript is frozen in time as well. Since I don't really see many Windows Mobile Standard devices coming out and I refuse to use a phone that requires a stylus, my next phone will likely be an android device (which interestingly enough, has an opera mini port).

There are probably a few bugs lurking around in the code for some fringe cases, but as always, you are welcomed to examine and update the script to your needs and it would be very appreciated if you would post a link to the update here. Also, I think JZ's SmartMort script is still keeping things interesting so you may want to check that out.


Find the link to my software in my signature.

lexluthor
12th November 2009, 01:54 PM
Too bad, I'd love to see Opera Mini 5 support too.