Custom File Associations: Multiple applications per single pattern

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
John_C
Posts: 336
Joined: 16 May 2018 20:04

Custom File Associations: Multiple applications per single pattern

Post by John_C »

Is it possible somehow to specify multiple applications per single pattern?

Here is what I mean:

Code: Select all

html>Sublime Text;Chrome
or maybe
htm;html>Sublime Text;Chrome

Sublime Text to edit, Chrome to preview
The idea is that when you double-click the file (or press the Enter key instead), you will be promted which one of the specified applications to use.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Custom File Associations: Multiple applications per single pattern

Post by highend »

Sure, e.g. use a script instead that let's you select the application from a popup menu...
One of my scripts helped you out? Please donate via Paypal

RalphM
Posts: 1932
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Custom File Associations: Multiple applications per single pattern

Post by RalphM »

What you describe is somewhat the standard behavior of CFA's.
You can set one default application for each extension (or group of extensions) which is used on enter or dbl-click, all further (non-default) entries for the same extensions are shown in the CFA menu (button or Ctrl+Alt+Enter) to choose from.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

John_C
Posts: 336
Joined: 16 May 2018 20:04

Re: Custom File Associations: Multiple applications per single pattern

Post by John_C »

highend wrote: 19 Jul 2022 10:42 Sure, e.g. use a script instead that let's you select the application from a popup menu...
Could you provide some help with this script? I simply don't understand what is the starting point to create it...

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Custom File Associations: Multiple applications per single pattern

Post by highend »

Code: Select all

    $apps = <<<>>>
Sublime Text|{your path to sublime text.exe}
Chrome|{your path to chrome.exe}
    >>>;
    $apps = regexreplace($apps, "^(.+?\|)(.+?)(?=\r?\n|$)", "$1$2|$2");

    $sel = popupmenu($apps, 6:=<crlf>, 7:="|");
    if ($sel) { run lax("$sel" "<pfaitem>"); }
htm;html>::load "{name of the script.xys}";
One of my scripts helped you out? Please donate via Paypal

Post Reply