starting a script by clicking on a PaperFolder item
-
zakhar
- Posts: 179
- Joined: 08 Sep 2010 21:13
starting a script by clicking on a PaperFolder item
Hello, dear XYplorer Community!
I would like to know, if it is possible to start a script by clicking on a paperfolder item.
(something like Custom File Associations)
I would like to know, if it is possible to start a script by clicking on a paperfolder item.
(something like Custom File Associations)
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: starting a script by clicking on a PaperFolder item
Single click directly on the item? No. Double-click, sure, use a CFA with a script...
One of my scripts helped you out? Please donate via Paypal
-
zakhar
- Posts: 179
- Joined: 08 Sep 2010 21:13
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: starting a script by clicking on a PaperFolder item
Code: Select all
if (regexmatches(tab("get", "path"), "^paper:")) {
// do something here?
}
One of my scripts helped you out? Please donate via Paypal
-
autocart
- Posts: 1422
- Joined: 26 Sep 2013 15:22
Re: starting a script by clicking on a PaperFolder item
zakhar,
A paperfolder item, what is that for you?
An item inside a paperfolder, i.e. when you have the paperfolder open in the list view and you are then clicking on one of those items in that list view?
A paperfolder item, what is that for you?
An item inside a paperfolder, i.e. when you have the paperfolder open in the list view and you are then clicking on one of those items in that list view?
[AHK] redirecting Windows Explorer to XY, [XYS] Mini Tree with open tabs (cur loc expanded, tab folders highlighted), [AHK] customInlineRenameKeys, [AHK] clipboardHelper_and_XYEscToList
-
zakhar
- Posts: 179
- Joined: 08 Sep 2010 21:13
Re: starting a script by clicking on a PaperFolder item
highend, this is already a script.highend wrote: ↑02 Nov 2021 14:42Code: Select all
if (regexmatches(tab("get", "path"), "^paper:")) { // do something here? }
I mean the CFA must be given as "[file extension or "something mentioned in XYplorer's Help file under CFA"]>[action]".
Edit:
XYplorer's Help file: "Paper Folders are simple text files that contain the full paths to items, one per line. XYplorer employs those files as virtual folders.".
I would say not "when you have the paperfolder open" but "when you have the paperfolder loaded".
Last edited by zakhar on 02 Nov 2021 15:08, edited 1 time in total.
-
zakhar
- Posts: 179
- Joined: 08 Sep 2010 21:13
Re: starting a script by clicking on a PaperFolder item
I have found something under CFA in XYplorer's Help file:
"Variables
XYplorer native variables and environment variables are supported in the pattern list. E.g., the following pattern will only match TXT files in the Paper Folder folder:
<xypaper>\*.txt>::echo <focitem>;".
I will try it now.
"Variables
XYplorer native variables and environment variables are supported in the pattern list. E.g., the following pattern will only match TXT files in the Paper Folder folder:
<xypaper>\*.txt>::echo <focitem>;".
I will try it now.
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: starting a script by clicking on a PaperFolder item
So you were not talking about paper folder items but the paper folder files themselves...
One of my scripts helped you out? Please donate via Paypal
-
autocart
- Posts: 1422
- Joined: 26 Sep 2013 15:22
Re: starting a script by clicking on a PaperFolder item
[action] can be a one-line script:
["something mentioned in XYplorer's Help file under CFA"]>::if (regexmatches(tab("get", "path"), "^paper:")) {// do if paper} else {//do if not paper}EDIT:
To open a non-paper-folder-item with the default application:
["something mentioned in XYplorer's Help file under CFA"]>::if (regexmatches(tab("get", "path"), "^paper:")) {// do if paper item} else {open <pfaitem>, w;}[AHK] redirecting Windows Explorer to XY, [XYS] Mini Tree with open tabs (cur loc expanded, tab folders highlighted), [AHK] customInlineRenameKeys, [AHK] clipboardHelper_and_XYEscToList
-
zakhar
- Posts: 179
- Joined: 08 Sep 2010 21:13
-
zakhar
- Posts: 179
- Joined: 08 Sep 2010 21:13
Re: starting a script by clicking on a PaperFolder item
Code: Select all
<xypaper>\*.txt>::load "<xypath>\Data\Scripts\pf.xys";After clicking on an item (a folder in the XYplorer's list in a loaded paperfolder)
the experimental script pf.xys (only
Code: Select all
echo "1";Do not know what to do.
Last edited by zakhar on 02 Nov 2021 15:58, edited 1 time in total.
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: starting a script by clicking on a PaperFolder item
Of course not. CFA doesn't support folders, use a custom event action with a changing location event for these
One of my scripts helped you out? Please donate via Paypal
-
autocart
- Posts: 1422
- Joined: 26 Sep 2013 15:22
Re: starting a script by clicking on a PaperFolder item
Of course. You quoted it yourself.zakhar wrote: ↑02 Nov 2021 15:54does not work as I expect it to work:Code: Select all
<xypaper>\*.txt>::load "<xypath>\Data\Scripts\pf.xys";
After clicking on an item (a folder in the XYplorer's list in a loaded paperfolder)
the script pf.xys (only echo "1";) does not start.
Do not know what to do.![]()
Put <xypaper> in the address bar and hit Enter. Then you will understand. That's why highend got confused with what you want.wrote:E.g., the following pattern will only match TXT files in the Paper Folder folder:
<xypaper>\*.txt>::echo <focitem>;".
[AHK] redirecting Windows Explorer to XY, [XYS] Mini Tree with open tabs (cur loc expanded, tab folders highlighted), [AHK] customInlineRenameKeys, [AHK] clipboardHelper_and_XYEscToList
-
autocart
- Posts: 1422
- Joined: 26 Sep 2013 15:22
Re: starting a script by clicking on a PaperFolder item
zakhar wrote: ↑02 Nov 2021 15:54After clicking on [...] a folderCode: Select all
<xypaper>\*.txt>::load "<xypath>\Data\Scripts\pf.xys";
Oh, but even if CFA did support folders, why do you, zakhar expect
*.txt to be triggered when clicking a folder?[AHK] redirecting Windows Explorer to XY, [XYS] Mini Tree with open tabs (cur loc expanded, tab folders highlighted), [AHK] customInlineRenameKeys, [AHK] clipboardHelper_and_XYEscToList
-
autocart
- Posts: 1422
- Joined: 26 Sep 2013 15:22
Re: starting a script by clicking on a PaperFolder item
Did you already try what highend and me wrote up above?
I don't think so. E.g. viewtopic.php?p=192451#p192451
[AHK] redirecting Windows Explorer to XY, [XYS] Mini Tree with open tabs (cur loc expanded, tab folders highlighted), [AHK] customInlineRenameKeys, [AHK] clipboardHelper_and_XYEscToList
XYplorer Beta Club