Main Menu
Login
OpenWith macro
  Posted on Tue 28 Feb 2006 (8359 reads)
OPENWITH MACRO
Current release of OpenWith macro is: 1.2-3.


SUPPORTED PLATFORM
All Psion machines with EPOC OS and installed Macro5 application.


KEYWORDS
console application, Macro5.


MOTIVATION
OpenWith is inspired by psiLoc's plOpenWith. Basically OpenWith allows you to associate different applications to different filetypes. Even you can have more applications associated for one filetype or folder.
Actually you can use OpenWith for managing: RAR(emxunrar), ARJ(emxunarj), ZIP(emxzip,emxunzip), LHA(emxlha), ACE(emxunace), TAR(emxtar), GZ(emxgzip), BZ2(emxbzip), SIS(emxsis) archive files.

DOWNLOAD
You can download OpenWith distribution with binaries and sources from: Patisoners-Psion-macros download section.


HOW WORK OPENWITH MACRO
Activate OpenWith on selected file in system shell by pressing FN+SHIFT+ENTER. OpenWith will search in database for file extension. In case that extension was found, OpenWith will ask you to chose appropriate application (if more than one application) to open the file (see picture 1, 2 below). If application's extension is not in the database, OpenWith will search in "any file extension" applications. These applications are configured in the database with extension name * (multiply sign).

OpenWith database is stored in EPOC Data format in standard Macro folder. See example database for more details.

For example you want to open a html file in Editor and make some changes in content. Normally, you need to start Editor and open it from here. OpenWith allows you to open it directly from shell. You also can install more web browsers and select in which to open the file.

Hotkeys: FN+SHIFT+ENTER

Open in new window

Another example is to use this macro to open selected file with FileDump to explore the contents, pack it with emx's ZIP, GZIP, TAR...etc.. You can configure this macro to compress whole folders, decompress files, play music, view pictures... anything! You can study attached openwith database where are most cases covered.

Example screen to pack selected file with GZIP (move to archive). Of course you can configure the macro to decompress files with extension GZ.

Open in new window


OPENWITH DATABASE
Each row in database is one OpenWith file extension rule.

Open in new window


There are two special types of extensions:
Any file means look here if extension was not found in the database. (you might want to look at 'unknown filetypes' with typical set of tools (like FileDump, Editor, PsiDat...etc)

Any folder is set of tools applied on the folder. You can ZIP whole folder for example.


OPEN WITH DATABASE FIELDS

EXT
Extension - extension of the file
* - any file (excluding already defined)
\ - any folder

ORD
Order - order in which the application will appear in OpenWith dialog. The most favourite application should have number 1.

C++ CAPTION
C++ name of the application (eg. Editor, Web, Opera) or:

OPL - in case that the application was written in OPL
EXE - "command line" commands

Note that you can also use special commands:
%p - path
%n - name
%e - extension
%c - complete filename
%P, %C - same as %p, %c, but \ is replaced by / to keep UNIX-like convention if needed (programs written in emx)
%f - full name (with extension) (new in ver.1.2)
%e - dot and extension (or nothing if extension is blank) (new in ver.1.2)


APP PATH
Full path of APP file in case that application is written in OPL or full path of EXE file.

MESSAGE
Your own name of current operation. For example Move to archive, play SID...etc. If you leave this field blank, OpenWith will try to guess the name from AppPath or C++ caption.


EXAMPLE
Example demonstrate one database row (one OpenWith rule for extension .rar )
This rule start emxshell:

d:\emx\bin\sh.exe

with parameters (change directory to directory with RAR archive, run unrar and extract this archive):

--cd /%P --run /bin/unrar.exe x %f

More examples you can find in EPOC database file OpenWith.db or in plain text file OpenWith.csv.


TIPS AND TRICKS
For creating new and complicated rules you can use tstcmd.exe which only display full command line and also separate all parameters. For example try:


CONTACT
Any bugs, recommendations, feedback send to osg at atlas dot cz or use "Contact us" in Main Menu.

OSG & Poke
2006-03-01
Index :: Print
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread