Page 1 of 1

Executor - Run applications with PFA / Scripting / Buttons

Posted: 06 Mar 2015 08:54
by highend
This one is the little brother of FluxTorpedoe's Power Launcher (http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=9300)

It's (imho) a little bit easier to setup but it also supports "only" left-, right-, and doubleclickactivation (and can be invoked by scripting with it's left- and rightclick label).

Additionally it supports chaining of categories so that you only need to setup an application once and assign it to multiple categories in one line...

I mainly use it with a portable file association like this:

Code: Select all

*>::load "Executor.xys";
But it can be called e.g. with:

Code: Select all

load "Executor", "_LeftClick";
load "Executor", "_RightClick";
from scripts | UDCs or buttons...

There is no "_DoubleClick" label. If called without any label, double click is assumed automatically.

Directories aren't supported for actions (although I could implement this for left- & rightclick if there is a strong need for that).

It needs an .ini file for configuration. Download "Executor_Sample.zip", extract it and rename it into "Executor.ini" (and put it in the same folder as the "Executor.xys" script!)

You can define more than one application for a category. The first one that is found (means: exists) is used.


Regarding chained categories:

Code: Select all

[Categories]
ahk=ahk
au3=au3
cod=cfg|cs|css|dat|ini|js|lua|nsh|nsi|nsis|php|py|sql|uew|xml|xys
pb=pb|pbi
st=sublime-build|sublime-commands|sublime-completions|sublime-keymap|sublime-menu|sublime-mousemap|sublime-project|sublime-settings|sublime-snippet|sublime-workspace|tmLanguage|tmPreferences|md
txt=nfo|txt

[DoubleClick]
ahk;au3;cod;pb;st;txt=<xydrive>\Tools\Sublime Text\sublime_text.exe
Sublime Text is used for all of these category entries (and therefore all of their defined extensions)...


Current version: v1.6
Executor_v1.6.xys
(7.11 KiB) Downloaded 230 times
Sample config:
Executor_Sample.zip
(880 Bytes) Downloaded 399 times
Old versions:
Executor_v1.5.zip
(2.4 KiB) Downloaded 229 times
Executor_v1.2.zip
(1.72 KiB) Downloaded 340 times
Executor_v1.1.zip
(1.7 KiB) Downloaded 335 times
Executor_v1.0.zip
(1.57 KiB) Downloaded 389 times

Re: Executor - Run applications with PFA / Scripting / Butto

Posted: 06 Mar 2015 21:20
by klownboy
Hi highend, great idea. I'm having problems getting it to work though the way I "think" it's suppose to work. I'm using v14.80.0240. My modified line in the executor.ini looks like this...

Code: Select all

vid=avi|wmv|mkv|mp4|mpg|mpeg|vob|img|mov|divx|flv|asf|ts
which is as in your sample. And, under [RightClick]: Note I put a semi-colon in front of vid under DoubleClick and LeftClick.

Code: Select all

[RightClick]
vid=D:\DVD\VLC\vlc.exe
The instruction in the sample about [un]comments was confusing.
; Uncommenting an entry in any section requires a leading semicolon
Do you mean " Uncommenting an entry in any section requires a removing the leading semicolon" (i.e., I assume we have to remove ";" to 'un'comment the line as opposed to adding one. :eh: By the way, VLC is not by system association for videos.

Anyway when I double click the filename, the video runs in VLC but nothing happens when I right click. My PFa line looks like this, but I've tried this without the "RightClick" label as well with the same result. I also had "<pfaitem>;" at the end of the pfa as well with the same result.

Code: Select all

"ExecutorRight|D:\Graphics\Icons\video_08.ico" *>::load "<xyscripts>\Executor.xys", "_RightClick";
Any idea on what may be wrong? Is the video suppose to run with a single right click or did I overlook something above? Will the right click mouse action work only if invoked from a script or CTB?
Thanks,
Ken

Re: Executor - Run applications with PFA / Scripting / Butto

Posted: 08 Mar 2015 16:08
by highend
; Uncommenting an entry in any section requires a leading semicolon
I'll rewrite it to make it clearer. A line with a leading ";" is a comment (by default in any .ini file).
Any idea on what may be wrong? Is the video suppose to run with a single right click or did I overlook something above? Will the right click mouse action work only if invoked from a script or CTB?
Your PFA is something that only reacts on double click. Until there is no real custom event action system (I guess). The double click on the video file leads to executing my script with the _RightClick label for that file. That's why VLC plays it on double click. Right clicking the video does nothing (the PFA isn't triggered at all) so:

Code: Select all

Will the right click mouse action work only if invoked from a script or CTB?
Exactly!

Re: Executor - Run applications with PFA / Scripting / Butto

Posted: 08 Mar 2015 16:59
by klownboy
Thanks highend,
highend wrote:A line with a leading ";" is a comment (by default in any .ini file).
I did know that. That's why I thought the wording was a bit odd or backwards :wink:
Thanks,
Ken

Re: Executor - Run applications with PFA / Scripting / Butto

Posted: 08 Mar 2015 17:41
by PeterH
Sorry: non-native english here, but as I'd think:

comment is a line that's commented: with ;
uncomment is make it active, i.e. remove ;

Isn't it this way?

Re: Executor - Run applications with PFA / Scripting / Butto

Posted: 08 Mar 2015 17:51
by klownboy
Yes exactly, to comment a line ensure a ";" is added or placed in front of it as we would place "//" use in XY.
To uncomment a line, which obviously is already commented, to make it active you'd have to remove the existing ";". :)

Re: Executor - Run applications with PFA / Scripting / Butto

Posted: 11 May 2016 16:40
by highend
I released a small update (v1.1) because of the recent change in XY:
v16.60.0306 - 2016-04-28 12:45
* Portable File Associations: LNKs are now passed unresolved, i.e. as *.lnk,
to the associated applications or scripts.
Now .lnk files are resolved first so that everything should work fine again...

I've replaced the sample config with a better definition of what a semicolon in the config means (finally) :D

Re: Executor - Run applications with PFA / Scripting / Butto

Posted: 17 Nov 2016 21:42
by highend
Small update (v1.2)

The script choked on files for which you don't have something defined in the ini and Windows has no open= entry in the registry defined.
Now the windows default dialog to select an application is displayed whenever that happens instead of a script failure...

Re: Executor - Run applications with PFA / Scripting / Buttons

Posted: 13 Dec 2021 11:42
by highend
If anyone is (still) using it (it's my default CFA launcher so I do it on every (double-) click on a file...
v1.3
+ Better handling of file(s) without an extension

v1.4
* Changed multi (with labels) to single script type
+ Handling of invocation via Everything by a perm variable

v1.5
* Changed handling of .lnk files (that point to a file, not a folder)
Now they are opened by Windows to retain their full functionality
I'm adding v1.5 to the first post...

Re: Executor - Run applications with PFA / Scripting / Buttons

Posted: 10 Mar 2022 16:08
by highend

Code: Select all

v1.6
  * Open .lnk files with the shell
!!! The wrong category for an app could have been chosen because the
    belonging regex wasn't explicit enough. E.g.: Two categories
    "doc" and "docs" are defined:
    doc=doc|docx|odt|ott|rft
    docs=adoc|md

    Now if there are two applications where the first one should open "docs"
    it would automatically open all files from the category "doc" as well