Page 1 of 1

PFA match all folders

Posted: 05 Jun 2014 06:02
by binocular222
In Help file: "To match all folders use a single \ (backslash)." I tried this PFA:

Code: Select all

\>::echo Hi
- When press Enter, the folder is open (PFA is ignored?!)
- When press Ctrl+Enter, PFA menu popup, the entry with above code does showup, selecting this entry will trigger ::echo Hi
=> Does the PFA is ignored when pressing Enter?

Re: PFA match all folders

Posted: 05 Jun 2014 09:35
by nerdweed
Default PFA was never intended for folders. Its always browsed to using XY.

If it would have been, CEA would have been in place as well :whistle:

Re: PFA match all folders

Posted: 05 Jun 2014 13:11
by binocular222
Mat I make a wish?
Or there;s any trick to "Do some script instead of opening folders"?

Re: PFA match all folders

Posted: 05 Jun 2014 14:26
by nerdweed
When I had gone to the changelog, it did mention that it is not for for folders. It is Portable File Association after all.

I wish for it too - it will open a world full of possibilities if this can be done. It would allow to hook our scripts to folders.

Re: PFA match all folders

Posted: 05 Jun 2014 14:38
by TheQwerty
I cannot think of any way to achieve this with PFAs today, and I'm not sure Don will give us the power to so easily break basic navigation of the file system. :?


Your next bet is either to run the script instead of entering the folder, so it can do whatever you want on the selection and then enter the folder. The script could even then be put into a Custom Column with click trigger so that you can trigger it from within the list, though I'm not sure how or even if you can trigger a CC via keyboard.


If you only want to do this script when entering certain folders you could use a hacky solution where you dedicate a Custom Column to the script, use Folder View Settings to only show that column when browsing the locations you want to trigger it, and then use a script like the following. However, this won't work when the folder is empty.

Code: Select all

// Tracks when this script is triggered.
// This way we can restrict running to
// the first item in the list.
perm $P_LAST_ENTERED;
  if ($P_LAST_ENTERED != '') {
    // If triggered within the last minute abort.
    if (DateDiff($P_LAST_ENTERED,, 'n') < 1) {
      return;
    }
  }
  $P_LAST_ENTERED = now();

  // Whatever script you want...
  echo 'hi';
Snippet:

Code: Select all

Snip: CustomColumn 1
  XYplorer 14.10.0112, 6/5/2014 8:31:52 AM
Action
  ConfigureColumn
Caption
  Folder Script
Type
  3
Definition
  // Tracks when this script is triggered.
  // This way we can restrict running to
  // the first item in the list.
  perm $P_LAST_ENTERED;
    if ($P_LAST_ENTERED != '') {
      // If triggered within the last minute abort.
      if (DateDiff($P_LAST_ENTERED,, 'n') < 1) {
        return;
      }
    }
    $P_LAST_ENTERED = now();
  
    // Whatever script you want...
    echo 'hi';
Format
  0
Trigger
  0
Item Type
  2
Item Filter
  
[/size]