Starting a script by clicking on file/folder and markers

Features wanted...
Post Reply
zakhar
Posts: 150
Joined: 08 Sep 2010 21:13

Starting a script by clicking on file/folder and markers

Post by zakhar »

Hello, dear XYplorer Community!

My wish is as follows:
XYplorer should have a function to load a script by clicking directly on a file / folder.

I use many lnk-files to open folders and files.
But the problem is, that the lnk-files of windows open/start only
one item at once. (Using bat-files is not convenient for me). The mentioned function of XYplorer would make possible
to not only open files/folders, but also add any scripting functionality
to this action and therefore effectively replace lnk-files of windows for those
using this function.

My "subwish" in this direction is that XYplorer could be able to load a script if a file/folder
is clicked, which name contains a marker, that could be recognised by XYplorer as a command
to open an associated script. The marker and the associated script could be defined
by user somewhere in XYplorer's settings.
Example:
The file name is "birthdays_list_X123.xls" or "birthdays_X123_list.xls" or "X123_birthdays_list.xls".
The "X123" sequence is set by user as marker to load a script.xys.
Every time a file/folder with "X123" sequence is clicked in XYplorer the script.xys is executed.
This mechanism could also work if XYplorer is commanded to open a file / folder with
marker sequence per command line.

Thank you!

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

Re: Starting a script by clicking on file/folder and markers

Post by highend »

You are free to use CFAs to do this (at least by double clicking on files)...

Code: Select all

*>::load "your script to handle everything.xys";
and markers?

Tag those items and let the initial script decide what to do and what subscript to load by reading that tag...
One of my scripts helped you out? Please donate via Paypal

zakhar
Posts: 150
Joined: 08 Sep 2010 21:13

Re: Starting a script by clicking on file/folder and markers

Post by zakhar »

Thanks, highend!
It does what I wanted!

zakhar
Posts: 150
Joined: 08 Sep 2010 21:13

Re: Starting a script by clicking on file/folder and markers

Post by zakhar »

I have added the line

Code: Select all

lnk>..\script.xys
under CFAs.

Is it possible to conditionally bypass this setting in the script.xys?

The problem is, that the code placed in the script.xys

Code: Select all

open "C:\...\*.lnk";
that normally leads to the normal function of a lnk-file (opening of something by XYplorer)
makes a loop and loads the script.xys again.

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

Re: Starting a script by clicking on file/folder and markers

Post by highend »

Don't use open on a lnk?

Get the #LinkTarget property of the clicked .lnk and use a goto instead
One of my scripts helped you out? Please donate via Paypal

zakhar
Posts: 150
Joined: 08 Sep 2010 21:13

Re: Starting a script by clicking on file/folder and markers

Post by zakhar »

Yes!
It works!
Thank you, highend!

Post Reply