ARexx, FAB Menus, MIME Types & URL Prefs

Last Updated: 20th June 2003


<< Tips & Tricks Chapter Contents Chapter Troubleshooting Chapter >>

Introduction
In order to get the most out of your software, you might like to make use of four particular features of IBrowse²: ARexx, FAB Menus, MIME Types & URL Prefs. This section has been put together to give you examples of using each of these features to give you some idea of how they work, and you can even use the examples in your IBrowse² environment if you find them useful!

ARexx
This ARexx script was kindly submitted by Bill Eaves to demonstrate the use of the GOTOURL ARexx command, with the SAVE switch. It will download the image when executed from the FAB Menus » Image or FAB Menus » Imagelink menus, and using Directory Opus Magellan, set it as a new desktop image. You can enter the following into a text editor in order to re-create the script, or download the archive (the ARexx script and readme) via the link below. If you create the script yourself, save it as desktop.ibrx and save it in the Rexx directory in the IBrowse directory, i.e. PROGDIR:Rexx/desktop.ibrx.
/* desktop.ibrx - by W. Eaves May 2002 */
/* Sets image displayed in IB as DOpus Desktop */

OPTIONS RESULTS

IMPATH="Data:Images/" /* Path where IB stores saved images */

PARSE ARG URL

/* GET filename from URL */
N=LASTPOS("/",URL)

IF N ~= 0 THEN DO

  GOTOURL SAVE URL

  Filename = SUBSTR(URL, N+1)

  ImageName = '"'||IMPATH||Filename||'"'

  ADDRESS COMMAND WAIT 10 /* Make sure image is downloaded fully */


  IF SHOW('P',DOPUS.1) THEN DO
    ADDRESS "DOPUS.1"
    DOPUS SET BACKGROUND ImageName DESKTOP TILE
    DOPUS REFRESH BACKGROUND
  END

END
http://www.ibrowse-dev.net/resources/IBdesktop.lzx

FAB Menus
Using the example ARexx script above, we will add two new custom FAB Menu items so that you can use the ARexx script when you have the mouse pointer over an image or imagelink.
The procedure for accessing FAB Menus preferences is as follows:
  • Launch IBrowse² as normal.
  • Open the Settings via Menus » Preferences » Settings....
  • When the Preferences opens, double click on GUI in the list on the left of the window, and a new set of options will appear.
  • Click on FAB Menus in the new options, and a new set of options will open in the right hand side.
Selecting The FAB Menus Prefs
To add the custom FAB Menu, proceed as follows:
  • Double click on the menu title that you would like to add the new custom entry to, e.g. Image.
  • Click on Custom in the list of available commands to highlight it and hold down the left mouse button.
  • Drag the Custom entry to the menu list. As you move over the list, the drop zone(s) will be highlighted.
  • Move the mouse down the list until you find the position you would like to add the new entry.
  • Release the left mouse button to drop the Custom entry into the selected position.
Adding The Custom FAB Menu Entry
To configure the custom FAB Menu, proceed as follows:
  • Enter a suitable Name for the entry, e.g. Set as wallpaper
  • Set Action to ARexx.
  • Enter the path and name to the ARexx script into the string gadget next to the Action gadget, or use the file requester gadget to the right to locate the script. e.g. Rexx/desktop.ibrx
  • Click on the gadget next to the last string gadget to open the popup menu.
  • Select %i - Current image URL from the menu to enter %i into the string gadget.
  • Click on the OK gadget to accept the changes.
Adding The Custom FAB Menu Entry
If you would like to also use this new FAB Menu entry over imagelinks, then repeat the process but add the Custom entry to the ImageLink menu. If you would like to keep the changes made to the FAB Menus, save the settings via the Menus » Preferences » Save settings option. Resulting Image FAB Menu

MIME Types
IBrowse² comes with a default set of MIME Types already pre-configured, but there are many more types that can be optionally configured based on your own requirements. The following are examples of some MIME Types that you may like to configure.
Shockwave Flash • Macromedia • http://www.macromedia.com
Shockwave Flash Image Requires: swfplayer
http://www.aminet.net/gfx/show/swfplayer.lha
MIME Type: application/futuresplash
Extension: spl
Action: External viewer
Viewer: <path>/swfplayer
Arguments: >NIL: "%f" PUBSCREEN %p
MIME Type: application/x-shockwave-flash
Extension: swf
Action: External viewer
Viewer: <path>/swfplayer
Arguments: >NIL: "%f" PUBSCREEN %p
Portable Document Format • Adobe Inc. • http://www.adobe.dom
PDF Image Requires: APDF
http://www.aminet.net/gfx/show/apdf_fonts.lha
http://www.aminet.net/gfx/show/apdf_nofpu.lha
http://www.aminet.net/gfx/show/apdf_68030fpu.lha
http://www.aminet.net/gfx/show/apdf_68040fpu.lha
http://www.aminet.net/gfx/show/apdf_68060fpu.lha
http://www.aminet.net/gfx/show/apdf_ppc.lha
MIME Type: application/pdf
Extension: pdf
Action: External viewer
Viewer: <path>/Apdf
Arguments: >NIL: "%f"
MPEG Layer I, II & III Audio • Moving Picture Expert Group • http://mpeg.telecomitalialab.com/
MPEG Audio Requires: mpega
http://www.aminet.net/mus/play/mpega.lha
http://www.aminet.net/util/libs/mpega_library.lha
MIME Type: audio/mpeg
Extension: mp2 mp3 mpa
Action: External viewer
Viewer: <path>/mpega
Arguments: >NIL: "%f"
MPEG Layer I, II & III Audio (Streamed) • Moving Picture Expert Group • http://mpeg.telecomitalialab.com/
MPEG Audio Requires: mpega & StreamMP3
http://www.aminet.net/mus/play/mpega.lha
http://www.aminet.net/util/libs/mpega_library.lha
http://www.aminet.net/comm/www/streammp3.lha
MIME Type: audio/x-mpegurl
Extension: m3u
Action: External viewer
Viewer: SYS:RexxC/RX
Arguments: <path>/StreamMP3.rexx "%f"
MIME Type: audio/x-scpls
Extension: pls
Action: External viewer
Viewer: SYS:RexxC/RX
Arguments: <path>/StreamMP3.rexx "%f"
Real Audio • RealNetworks, Inc • http://www.real.com/
Real Audio Requires: RAPlay
http://www.aminet.net/mus/play/raplay.lha
MIME Type: audio/x-realaudio
Extension: ra
Action: External viewer
Viewer: <path>/RAPlay
Arguments: >NIL: "%f"
Real Audio (Streamed) • RealNetworks, Inc • http://www.real.com/
Real Audio Requires: RAPlay & StreamRA
http://www.aminet.net/mus/play/raplay.lha
http://www.aminet.net/comm/www/streamra.lha
MIME Type: audio/x-pn-realaudio
Extension: ram
Action: External viewer
Viewer: SYS:RexxC/RX
Arguments: <path>/StreamRA.rexx "%f"
Microsoft IE5+ Web Archive Format • Microsoft • http://www.microsoft.com/
IE Web Archive Requires: mht.rexx
http://www.aminet.net/comm/www/ibmht.lha
MIME Type: text/x-mht
Extension: !mht
Action: External viewer
Viewer: SYS:RexxC/RX
Arguments: <path>/mht.rexx "%f"
AVI • Microsoft • http://www.microsoft.com/
AVI Film Requires: MooVId (Shareware) or PIV-MooVId (Freeware) or Action (AmigaOS®3.5+)*
http://www.aminet.net/gfx/board/piv-moovid.lha
http://www.reg.net/authors.asp?AuthorID=3759
* Replace "app_name" in the Viewer: entries below, with whichever version of MooVId you use: PIV-MooVId for PicassoIV users, or MooVId or Action for other users.
MIME Type: video/avi
Extension: avi
Action: External viewer
Viewer: <path>/app_name
Arguments: >NIL: "%f" PUBSCREEN=%p
MIME Type: video/x-msvideo
Extension: avi
Action: External viewer
Viewer: <path>/app_name
Arguments: >NIL: "%f" PUBSCREEN=%p
QuickTime • Apple Computer, Inc • http://www.apple.com/
QuickTime Requires: MooVId (Shareware) or PIV-MooVId (Freeware) or Action (AmigaOS®3.5+)*
http://www.aminet.net/gfx/board/piv-moovid.lha
http://www.reg.net/authors.asp?AuthorID=3759
* Replace "app_name" in the Viewer: entries below, with whichever version of MooVId you use: PIV-MooVId for PicassoIV users, or MooVId or Action for other users.
MIME Type: video/quicktime
Extension: mov qt
Action: External viewer
Viewer: <path>/app_name
Arguments: >NIL: "%f" PUBSCREEN=%p
MPEG Video • Moving Picture Expert Group • http://mpeg.telecomitalialab.com/
AVI Film Requires: RiVA
http://www.aminet.net/gfx/show/riva.lha
MIME Type: video/mpeg
Extension: mpe mpeg mpg
Action: External viewer
Viewer: <path>/RiVA
Arguments: >NIL: "%f" PUBSCEEN=%p

URL Prefs
The URL Prefs are an interesting feature of IBrowse², allowing you to control individual settings for individual, or groups of URLs. The URL can be anything from an entire web site, to just a particular page. The examples shown below are to provide you with a rough idea of how the URL Prefs should be used, and the use of wildcards to pattern match entries. The Strictness rating below each entry will give you an approximate idea of how strict the pattern matching is for the entry provided.
URL Pattern: http://www.somesite.com/index.html
This entry will only match the specified web page.

e.g. there could be an annoying animation on this page that you would like to disable, but allow animations on all other areas of this web site to operate as normal. By setting the URL pattern to the specific URL of the web page, you will restrict the options you set to just that web page.
Strictness: Very High
URL Pattern: http://www.somesite.com/#?
This pattern will match any web pages within the specified domain.

e.g. this web site may make use of some JavaScript that is not yet supported by IBrowse² so you wish to disable it. Using this pattern the option will not be applied to any sub-domains used by the web site. e.g. http://forums.somesite.com/
Strictness: High
URL Pattern: http://#?.somesite.com/#?
This pattern will match any pages on any sub-domains of the web site.

e.g. this web site may make use of some JavaScript that is not yet supported by IBrowse² so you wish to disable it. Using this pattern the option will be applied to all sub-domains used by the web site. e.g. http://forums.somesite.com/
Strictness: Medium
URL Pattern: https://#?.somesite.com/#?
This pattern will match any pages on any sub-domains of the web site, using the HTTPS protocol.

e.g. this secure web site may make use of some JavaScript that is not yet supported by IBrowse so you wish to disable it. Using this pattern the option will be applied to all sub-domains using the secure protocol used by the web site. e.g. https://shop.somesite.com/
Strictness: Medium
URL Pattern: #?.somesite.com/#?
This pattern will match any pages on any sub-domains of the web site, using any protocol.

e.g. this web site may make use of some JavaScript that is not yet supported by IBrowse so you wish to disable it. It may also have a secure link that is accessed via the HTTPS protocol, which also needs to have the JavaScript disabled. Using this pattern the option will be applied to all sub-domains and all protocols used by the web site. e.g. https://shop.somesite.com/
Strictness: Low
URL Pattern: #?.com/#?
This pattern will match any pages on the .com domain, using any protocol.

e.g. you may wish to stop all pages from .com web sites from being cached.
Strictness: Low
URL Pattern: #?
This is a very interesting wildcard pattern, as it allows you to match any URLs you visit.

This can be useful if you would like to set an option globally that is only available in the URL Prefs, such as Cache URLs or Spoof as Mozilla.
Strictness: Very Low

<< Tips & Tricks Chapter Contents Chapter Troubleshooting Chapter >>

Valid XHTML 1.0! ~ Upload This Local File To http://validator.w3.org To Validate Yourself

IBrowse² Documentation v2.3 © 2002, 2003 Dave Fisher ~ IBrowse² Development Team Revision 1.0