ÿþ<?xml version="1.0" encoding="UTF-16"?> <!-- Plugin for Opera 7.11 v2.0 RC2 by Thomas Dorf Nielsen Based on the Notepad plugin Get Opera at http://www.opera.com This plugin enables control of the norwegian Opera browser with the Palmbutler remote. Opera is ideally suited for TV browsing as it can elegantly scale/zoom any webpage. Furthermore Opera has a unique "spatial navigation" that makes jumping between links very easy. No mouse is needed! NOTES AND TIPS: 1) If your Opera is not installed in the default place you must change the path in the line that looks like this: Set Opera = Exec("%programfiles%\Opera7\opera.exe "+URL) 2) When you use the spatial navigation you can "get stuck" if you enter into a TextArea. Just press "M" twice. "M" is used to toggle between page scrolling and spatial navigation, but it also sends F9 to Opera, which returns focus to the page (to re-enable keyboard navigation). 3) You might want to make pop-up's appear in the background. Press F12 in Opera and choose "Open pop-up windows in background". 4) You can view ASCII-files with Opera (using zooming). This is great for movie descriptions, log files etc. The script automagically switch Opera to "User mode" when a file with suffix .txt .nfo .diz or .log is opened. You might want to select the user mode called "Accessibility" as default, as it is one of the best suited for TV usage. (First "View -> Style -> User mode", then "View -> Style -> Accessibility layout") If you understand style sheets you can make your own mode. 5) Opera can also be used to view images. You can even zoom and pan images! Opera enters its "slideshow" mode when it detects a "likely next page". If you open Opera with a directory of images as argument (for instance c:\Documents and Settings\My Documents\My Pictures\) Opera will display the next or previous image when you choose next/previous page (next/previous - or fforward/rewind). Installation: Go to the Palmbutler configuration, choose the "Plugins" tab, click "Add", locate and open this script. Then click "Associations" and change "htm" and "html" so they open with the Opera plugin. Additionally you can let Opera be Windows' default application for browsing: In Opera press Alt-p (preferences), click on "Default application" in the leftmost list and then select the file types and protocols that you want Opera to handle. Key definitions: Blue Zoom in by 10% Green Zoom out by 10% Red Restore zoom to 100% Ok Activate selected link (Enter) Navigation pad Arrow keys (Scrolling / Link selection) M Toggle between scrolling and Opera's "spatial navigation" (link selection) Play Activate selected link (Enter) Previous/Next Previous/Next page in history 1/2 Cycle back/forward between pages (In case of pop-up windows) 4 Toggle loading and display of graphics - "G" is on 4! ;-) (Opera can cycle between a) show no images, b) show only loaded images and c) show all images. This is great for slow connections or when you are only interested in reading the text.) Hold 4 Toggle "User mode". Opera can use its own style sheets to show all webpages in more readable ways. (Opera shortcut is Ctrl-g, "G" is on 4.) 5/6 Page left/right 7 Reload - "R" is on 7! 8/9 Page up/down Hold 8/9 Page top/bottom --> <Module> <?Script VBScript Dim Opera, WshShell Set WshShell = CreateObject("WScript.Shell") Dim starttime, passedseconds 'Used when starting Opera Dim spatialnavigation spatialnavigation = false 'Used to toggle "spatial navigation" in Opera ?> <Description>Opera plugin</Description> <RunWithShadow>false</RunWithShadow> <Standalone>false</Standalone> <Extension type="browserurl">htm</Extension> <Extension type="browserurl">html</Extension> <Extension type="browserurl">asp</Extension> <Extension type="other">txt</Extension> <Extension type="other">nfo</Extension> <Extension type="other">diz</Extension> <Extension type="other">log</Extension> <Extension type="picture">bmp</Extension> <Extension type="picture">gif</Extension> <Extension type="picture">jpg</Extension> <Extension type="browserurl">swf</Extension> <Events> <!-- Start Opera and do file extension checks, wait for 10 seconds and then start playing --> <OnInitialization> <?Script VBScript Dim LResult pbMenu.Visible = 0 URL=pbMenu.CurItem.URL 'Replace spaces in URL 'Internet Explorer is notoriously relaxed in its requirements for encoding 'spaces in URLs. (This tends to contribute to author sloppiness in authoring 'URLs.) But other browsers like Netscape and Opera are much more strict on this 'point, and spaces MUST be encoded if the URL is to be considered to be correct. URLnospaces=Replace(URL, " ", "%20") 'Replace spaces URLnospaces=Replace(URLnospaces, ",", "%2C") 'Replace commas ASCIIsuffixes = ".txt .TXT .nfo .NFO .diz .DIZ .log .LOG" picturesuffixes = ".bmp .BMP .gif .GIF .jpg .JPG" URLsuffix = Right(URLnospaces, 4) URLdirectory = Left(URLnospaces, InStrRev(URLnospaces, "\")) 'All characters up to and including the last "\" URLisweblink = InStr("http:// HTTP://", Left(URLnospaces, 7)) > 0 'If picture then do UGLY hack to make Opera aware of other pictures in same directory 'If a picture is selected, start Opera with the directory as argument (but if weblink, start as normal!) If InStr(picturesuffixes, URLsuffix) And Not URLisweblink Then 'Start Opera application - NOT with the file but with the directory! Set Opera = Exec("%programfiles%\Opera\opera.exe "+URLdirectory) Else 'Start Opera application with complete URL Set Opera = Exec("%programfiles%\Opera\opera.exe "+URLnospaces) End If 'Wait 10 seconds or until Opera has started starttime = Now passedseconds = 0 Do while Not WshShell.AppActivate(Opera.ProcessID) And passedseconds<20 passedseconds = DateDiff("s", starttime, Now) sleep 200 Loop 'Make sure Opera window is activated If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If 'If ASCII-file then switch to "User Mode" If InStr(ASCIIsuffixes, URLsuffix) Then LResult=WshShell.Sendkeys("^{g}") End If 'Done - Switch Opera to full screen mode LResult=WshShell.Sendkeys("{F11}") ?> </OnInitialization> <!-- Exit the script by closing Opera (Send Alt-F4) --> <OnFinalization> <?Script VBScript Dim LResult 'Make sure Opera window is activated If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 200 'Send Alt-F4 to Opera application LResult=WshShell.Sendkeys("%{F4}") pbMenu.Visible = 1 ?> </OnFinalization> <OnKeyBlue> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Scale page up by 10% LResult=WshShell.Sendkeys("0") ?> </OnKeyBlue> <OnKeyRepeatBlue> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Scale page up by 10% LResult=WshShell.Sendkeys("0") ?> </OnKeyRepeatBlue> <OnKeyGreen> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Scale page down by 10% LResult=WshShell.Sendkeys("9") ?> </OnKeyGreen> <OnKeyRepeatGreen> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Scale page down by 10% LResult=WshShell.Sendkeys("9") ?> </OnKeyRepeatGreen> <OnKeyRed> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Restore zoom to 100% LResult=WshShell.Sendkeys("6") ?> </OnKeyRed> <OnKeyUp> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Up If spatialnavigation Then LResult=WshShell.Sendkeys("+{UP}") Else LResult=WshShell.Sendkeys("^{UP}") End If ?> </OnKeyUp> <OnKeyRepeatUp> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 If spatialnavigation Then LResult=WshShell.Sendkeys("+{UP}") Else LResult=WshShell.Sendkeys("^{UP}") End If ?> </OnKeyRepeatUp> <OnKeyDown> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 If spatialnavigation Then LResult=WshShell.Sendkeys("+{DOWN}") Else LResult=WshShell.Sendkeys("^{DOWN}") End If ?> </OnKeyDown> <OnKeyRepeatDown> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 If spatialnavigation Then LResult=WshShell.Sendkeys("+{DOWN}") Else LResult=WshShell.Sendkeys("^{DOWN}") End If ?> </OnKeyRepeatDown> <OnKeyLeft> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 If spatialnavigation Then LResult=WshShell.Sendkeys("+{LEFT}") Else LResult=WshShell.Sendkeys("{LEFT}") End If ?> </OnKeyLeft> <OnKeyRepeatLeft> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 If spatialnavigation Then LResult=WshShell.Sendkeys("+{LEFT}") Else LResult=WshShell.Sendkeys("{LEFT}") End If ?> </OnKeyRepeatLeft> <OnKeyRight> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 If spatialnavigation Then LResult=WshShell.Sendkeys("+{RIGHT}") Else LResult=WshShell.Sendkeys("{RIGHT}") End If ?> </OnKeyRight> <OnKeyRepeatRight> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 If spatialnavigation Then LResult=WshShell.Sendkeys("+{RIGHT}") Else LResult=WshShell.Sendkeys("{RIGHT}") End If ?> </OnKeyRepeatRight> <OnKeyEnter> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 LResult=WshShell.Sendkeys("{ENTER}") ?> </OnKeyEnter> <OnKeyMenu> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If 'Toggle Opera's spatial navigation spatialnavigation = not spatialnavigation Sleep 100 'Restore focus to document (in case user is "trapped" in a text-box) LResult=WshShell.Sendkeys("{F9}") ?> </OnKeyMenu> <OnKeyPlay> <?Script VBScript URL=pbMenu.CurItem.URL If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 LResult=WshShell.Sendkeys("{ENTER}") ?> </OnKeyPlay> <OnKeyStop> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If 'Sleep 100 'ESC is a problem - it cancels full-screen as well! ;-( 'LResult=WshShell.Sendkeys("{ESC}") 'Sleep 200 'Switch Opera to full screen mode 'LResult=WshShell.Sendkeys("{F11}") ?> </OnKeyStop> <OnKeyPrev> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Go to previous page in history LResult=WshShell.Sendkeys("^{LEFT}") ?> </OnKeyPrev> <OnKeyRepeatPrev> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Go to previous page in history LResult=WshShell.Sendkeys("^{LEFT}") ?> </OnKeyRepeatPrev> <OnKeyNext> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Go to next page in history LResult=WshShell.Sendkeys("^{RIGHT}") ?> </OnKeyNext> <OnKeyRepeatNext> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Go to next page in history LResult=WshShell.Sendkeys("^{RIGHT}") ?> </OnKeyRepeatNext> <OnKey1> <?Script VBScript URL=pbMenu.CurItem.URL If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Cycle pages backward LResult=WshShell.Sendkeys("1") ?> </OnKey1> <OnKey2> <?Script VBScript URL=pbMenu.CurItem.URL If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Cycle pages forward LResult=WshShell.Sendkeys("2") ?> </OnKey2> <OnKey4> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Toggle loading and display of graphics - "G" is on 4 LResult=WshShell.Sendkeys("g") ?> </OnKey4> <OnKeyHold4> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Toggle between User mode / Author mode LResult=WshShell.Sendkeys("^{g}") ?> </OnKeyHold4> <OnKey5> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Page left LResult=WshShell.Sendkeys("^{PGUP}") ?> </OnKey5> <OnKeyRepeat5> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Page left LResult=WshShell.Sendkeys("^{PGUP}") ?> </OnKeyRepeat5> <OnKey6> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Page right LResult=WshShell.Sendkeys("^{PGDN}") ?> </OnKey6> <OnKeyRepeat6> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Page right LResult=WshShell.Sendkeys("^{PGdn}") ?> </OnKeyRepeat6> <OnKey7> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Reload page - "R" is on 7 LResult=WshShell.Sendkeys("{F5}") ?> </OnKey7> <OnKey8> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Page up LResult=WshShell.Sendkeys("{PGUP}") ?> </OnKey8> <OnKeyHold8> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Go to top of page LResult=WshShell.Sendkeys("{HOME}") ?> </OnKeyHold8> <OnKey9> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Page up LResult=WshShell.Sendkeys("{PGDN}") ?> </OnKey9> <OnKeyHold9> <?Script VBScript If not WshShell.AppActivate(Opera.ProcessID) Then MsgBox "App not activated", 0, ":-)" End If Sleep 100 'Go to bottom of page LResult=WshShell.Sendkeys("{END}") ?> </OnKeyHold9> </Events> </Module>