ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > FARR Plugins and Aliases

FARR plugin: Akete

<< < (4/14) > >>

ewemoa:
Ok, ok -- it is done :)

raybeere:
This is a great idea, but from my point of view there are two things that keep it from being useful when run from a USB stick. (At least from the description. I haven't tried it out yet. The last time I played around with anything on my stick, I was very, very sorry.) First, I'd like to see a simple way to turn it on and off, so when I wanted to use my own machine's associations, I could. (I do this when setting up a stick on my machine to keep the programs on it from running, so I get less reads / writes to the stick.) Second, I'd like to see a way to specify the relative path from the root without needing to specify a drive letter. After all, if I have to use my stick on another machine, I have no idea what letter it will be assigned - and if I'm doing that, nine times out of ten I'm in no mood to go in and change a bunch of settings right then.

Two other nice features would help out, a lot. One would be a chance to specify two options, by keyword, such as Open and Edit. I think the point there should be pretty clear. The other one is a workaround for a particular program I use, Liquid Story Binder XE. It is a great writing program, but it has one quirk. All files are arranged in a "library" by "book" - each book is a folder under one user-specified folder for the library. Each book actually contains a whole set of files. So, to open a "book" in LSB, you have to run LSB with the book's folder specified in the command line or shortcut. Is there any way to let the user specify such behaviour? (Open X app with the path of the selected file specified, but strip away the filename...)

ewemoa:
First, I'd like to see a simple way to turn it on and off, so when I wanted to use my own machine's associations, I could.
-raybeere (January 09, 2009, 04:21 PM)
--- End quote ---

I have an idea or two about this -- I intend to figure out whether they are practical.

Two other nice features would help out, a lot. One would be a chance to specify two options, by keyword, such as Open and Edit. I think the point there should be pretty clear.

--- End quote ---

If it doesn't have to be by keyword, there is already a way to specify multiple paths for each file extension -- this information is used in augmenting the context menu for a search result by a context menu item per path (you end up seeing something like "Open with myapp.exe" for each path).  I think I documented this feature in the README.txt of the plugin, but I don't recall at the moment.

The other one is a workaround for a particular program I use, Liquid Story Binder XE. It is a great writing program, but it has one quirk. All files are arranged in a "library" by "book" - each book is a folder under one user-specified folder for the library. Each book actually contains a whole set of files. So, to open a "book" in LSB, you have to run LSB with the book's folder specified in the command line or shortcut. Is there any way to let the user specify such behaviour? (Open X app with the path of the selected file specified, but strip away the filename...)

--- End quote ---

Currently, this is not supported.  mouser made a similar suggestion and we have discussed the possibility of support for something like what one can specify for an alias string.  So for example, you might be able to express something like:

  %PROGRAMFILES%\Something\Another.exe /p /e "$$1"

and $$1 would get filled in with the file identified via FARR and %PROGRAMFILES% would get resolved to the relevant path.

I intend to investigate this further too.

ewemoa:
I am drafting some documentation for a newer version and thinking that it may act as a specification.  This post should contain my first attempt.  Feedback is welcome ;)

Draft  Introduction
  ------------

  The main point of this plugin is to be able to customize how files
  with particular file extensions are opened.  To achieve this end,
  the user is expected to provide a configuration which specifies
  associations between file extensions and corresponding methods of
  opening files with those extensions.

  The plugin provides additional functionality including support for:

    * multiple possible methods of opening files via context menu items

    * default context menu items (i.e. always appear in context menu)

    * overriding of method to open files via an appropriate keyword

  Configuration
  -------------

  The Akete plugin may be configured by using FARR User Variables.

  FARR User Variables are accessible via "Program Options" ->
  "Lists" -> "User Variables" in FARR's Options dialog box.  The section
  for Akete (may not exist unless manually created) begins with the
  string [Akete].  (For more information regarding FARR User Variables,
  in FARR's .chm Help File, see the section titled "User Variables -
  Advanced Use" under "Advanced Use".  The rest of the text assumes
  familiarity with the FARR documentation content.)

  Configuration details will be demonstrated through a series of examples.
  After each example a general rule will be stated possibly followed by
  some related notes.

  Example 1

  A configuration to get files with the extension 'txt' to be opened using
  Wordpad might be:

    [Akete]
    txt=%PROGRAMFILES%\Windows NT\Accessories\wordpad.exe

  Rule 1: <file-extension>=<path-to-executable>

  Notes: The path to the executable may contain FARR Virtual Folder
  names (see the FARR help file).  Also, file extensions do NOT contain
  the period character.

  Example 2

  A configuration to get files with the extension 'txt' to be opened by
  (possibly additional instances of) Notepad++ might be:

    [Akete]
    txt=%PROGRAMFILES%\Notepad++\Notepad++ -multiInst "$$1"

  Rule 2: <file-extension>=<launch-template-string>

  Notes: The launch template string allows specification of command line
  arguments.  The plugin replaces the string $$1 by the path to the file to
  be opened.  Do NOT use the vertical bar character in a launch template
  string -- the reason for this should become clear below.

  Example 3

  A configuration to get files with the extension 'doc' to be opened using
  whatever is configured for 'txt' might be:

    [Akete]
    txt=%PROGRAMFILES%\Windows NT\Accessories\wordpad.exe
    doc=txt

  Rule 3: <file-extension>=<file-extension>

  Notes: For simplicity of configuration and implementation, if a file
  extension appears on the right hand side of an equals sign, it may not
  appear on the left hand side of the equals sign.  Another way to phrase
  this is that only one level of indirection is supported.

  Example 4

  A configuration to get the context menu of a file with extension 'txt'
  to show context menu items for opening via Wordpad and Notepad++ might be:

    [Akete]
    txt=%PROGRAMFILES%\Windows NT\Accessories\wordpad.exe|%PROGRAMFILES%\Notepad++\Notepad++ -multiInst "$$1"

  Rule 4: <file-extension>=<vertical-bar-separated-list-of-paths-or-templates>

  Notes: The items in the list may be paths or launch string templates. 
  The vertical bar character is reserved for separating the items so it may
  not be used in a path (doesn't tend to work in Windows anyway?) or a
  launch template string.  Opening of files via FARR's text edit field will
  be handled using the first item in the list.

  A configuration to get the context menu of a file with extension 'txt'
  to show context menu items for opening via Wordpad and Notepad, but leaves
  handling of opening of such files untouched if done via FARR's text edit
  field might be:

    [Akete]
    txt=|%PROGRAMFILES%\Windows NT\Accessories\wordpad.exe|C:\Windows\System32\notepad.exe

  Notes: One can think of the list as having an empty first item.

  Example 5

  A configuration to get the context menu of any file to show context menu
  items for opening via Wordpad, Notepad, and Emacs might be:

    [Akete]
    *=%PROGRAMFILES%\Windows NT\Accessories\wordpad.exe|C:\Windows\System32\notepad.exe|%PROGRAMFILES%\Emacs\bin\runemacs.exe

  Rule 5: *=<vertical-bar-separated-list-of-paths-or-templates>

  Notes: One can think of the asterisk character as similar to a wildcard
  pattern character.

  Example 6

  A configuration to get the plugin to recognize a keyword to override
  opening behavior for opening a particular file via FARR's text edit
  field might be:

    [Akete]
    openwithnpp=%PROGRAMFILES%\Notepad++\Notepad++.exe

  Subsequently, specifying a file along with the 'openwithnpp' keyword in
  FARR's text edit field (and "launching" for example, by pressing the
  Enter key) should lead to an attempt to open the specified file using
  Notepad++.exe.  The contents of the text edit field might look like:

   C:\boot.ini +openwithnpp

  Rule 6: openwith<string>=<path-or-launch-template-string>

  In summary, there are three types of user variable names (strings to the
  left of the equals sign) that may be specified:

    1) file extension
    2) string of the form openwith<some-string>
    3) *

  and two types of user variable values (strings to the right of the equals
  sign) that may be specified:

    1) list of paths and/or launch templates
    2) file extension



Edit: Updated draft

mouser:
great stuff ewe, very clear and great functionality!!
the only thing that would be nice is maybe to think of something shorter than "openwith" as the prefix needed for that function.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version