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

Search This thread

badbob001

Senior Member
Mar 28, 2005
324
17
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.

attachment.php
attachment.php

INTRODUCTION

You probably know of Menneisyys' original thread 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]
  • 04/06/2008 0.02b: Next version (based on info from JZ's script) [details]
  • 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]
  • 04/11/2008 0.05b: landscape support, address input optimizations, improved DAI tolerance, shortcut with icon created, filename change to ini file. [details]
  • 04/12/2008 0.06b: tweaked delay b/t keys and delay after paste [details]
  • 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]
  • 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]
  • 04/25/2008 0.09b: Exclusion list, Last Link saved, Improved shortcut icons, help file [details]
    Update: 04/25/2008 2:50pm EST: found a bug where trim would repeat forever. Fixed and re-uploaded. [details]
  • 05/15/2008 0.10b: Custom Commands, Improved Exclude options, Prompting with timeout, Quickswitch, Special Commands, JVM selection improvements, Fixes [details]
    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]
    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]
  • 06/17/2008 0.11b: Faster Startup, Better OM control, Select / Copy / Paste, HotKey, and many fixes. [url="http://xdaforums.com/showthread.php?t=384271&page=14#138][details][/url]
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.
 

Attachments

  • 0.07b_StartOperaMini.zip
    7.1 KB · Views: 343
  • 0.08b_StartOperaMini.zip
    8.1 KB · Views: 170
  • 0.09b_StartOperaMini.zip
    14.6 KB · Views: 698
  • 0.10bsp2_StartOperaMini.zip
    26.3 KB · Views: 194
  • 0.10bSP3_StartOperaMini.zip
    29.2 KB · Views: 637
  • 0.11b_StartOperaMini.zip
    48 KB · Views: 3,149
Last edited:

badbob001

Senior Member
Mar 28, 2005
324
17
attachment.php


attachment.php

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

    Jbed 3.1:
    http://xdaforums.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:
    1. On the device, use IE mobile and go to http://mini.opera.com
    2. 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.
    3. Click Download in another language.
    4. Now a list of all language versions appear so choose one. I prefer to download Opera Mini 4.1 International for foreign language websites.
    5. Click 'If this version fails to install or you would like to install a previous version, please click here.'
    6. 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
  1. 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.

  2. 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.
  3. 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.

  4. 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 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.
 

Attachments

  • 1.jpg
    1.jpg
    38.3 KB · Views: 7,649
  • 2.jpg
    2.jpg
    35.1 KB · Views: 7,525
  • 3.jpg
    3.jpg
    28.5 KB · Views: 7,545
  • 0.jpg
    0.jpg
    12.5 KB · Views: 7,596
Last edited:

volwrath

Senior Member
Oct 10, 2006
347
47
Nashville
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.
 

Azimuth21

Senior Member
Dec 11, 2006
229
2
San Jose, CA
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

Senior Member
Mar 28, 2005
324
17
Replaced
Code:
jbed_exe_ini = Part(RegRead("HKCR","jarfile\Shell\Open\Command",""),"""",2,1)

with
Code:
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

Senior Member
Mar 28, 2005
324
17
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.

Code:
LeftSoftKey [open menu]
LeftSoftKey [select Enter Address]

Code:
[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

Senior Member
Mar 28, 2005
324
17
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.

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

Senior Member
Dec 11, 2006
229
2
San Jose, CA
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

Senior Member
Jan 8, 2008
1,607
4
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

Senior Member
Mar 28, 2005
324
17
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.
 
Last edited:

volwrath

Senior Member
Oct 10, 2006
347
47
Nashville
It's relatively easy to slap on the menu option to my script, which tmknight did here.

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 :)
 

mskovrinskie

Senior Member
Feb 17, 2006
114
0
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

Senior Member
Jul 14, 2006
5,367
1,370
OnePlus 7 Pro
OnePlus Nord N200 5G
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.
 
Last edited:

cheesiest

New member
Aug 24, 2007
4
0
Extra carriage return?

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.
Code:
if ((opera_version_ini eq "4.1" AND direct_address_input eq True) OR (tried_again = True))
	sendcr
	[B]sleep(wait_time_between_keys)[/B]
	sendcr
endif
I don't know whether I fixed a script bug or my phone just has special needs.
 

badbob001

Senior Member
Mar 28, 2005
324
17
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.
Code:
if ((opera_version_ini eq "4.1" AND direct_address_input eq True) OR (tried_again = True))
	sendcr
	[B]sleep(wait_time_between_keys)[/B]
	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.

Code:
SendCtrlKey("V")
[b]Sleep(500)[/B]
SendLeftSoft

if ((opera_version_ini eq "4.1" AND direct_address_input eq True) OR (tried_again = True))
    [b]Sleep(500)[/b]
    sendcr
endif
 
Last edited: