Scripts on PFA

Features wanted...
Post Reply
jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Scripts on PFA

Post by jacky »

Code: Select all

  +++ Scripting and Portable File Associations (PFA): Now you can state 
      a one-line script as "application" in the definition of a PFA! 
You know, that sounds really cool, but I have to say it would be even better if there was a way to define a pattern instead of an extension, much like what we can do in Color Filters.

(Even better would be, for both PFA and Color Filters, another extra way to have such pattern be treated against the full path and not just the filename, so I could have specifics for say D:\Music\*.mp3 different than the regular *.mp3, things define for D:\Project\* or ?:\recylced\* or many more!)
Proud XYplorer Fanatic

admin
Site Admin
Posts: 66300
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripts on PFA

Post by admin »

jacky wrote:

Code: Select all

  +++ Scripting and Portable File Associations (PFA): Now you can state 
      a one-line script as "application" in the definition of a PFA! 
You know, that sounds really cool, but I have to say it would be even better if there was a way to define a pattern instead of an extension, much like what we can do in Color Filters.

(Even better would be, for both PFA and Color Filters, another extra way to have such pattern be treated against the full path and not just the filename, so I could have specifics for say D:\Music\*.mp3 different than the regular *.mp3, things define for D:\Project\* or ?:\recylced\* or many more!)
Yep, I have thought of that immediately as well. :)

What about:
- if the pattern contains no wildcards: it's treated against the extension (ensuring backward compatibility)
- elseif the pattern contains the character ":" then it's treated against the full path. Should work...
- else it's treated against the file name.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Scripts on PFA

Post by jacky »

admin wrote:What about:
- if the pattern contains no wildcards: it's treated against the extension (ensuring backward compatibility)
- elseif the pattern contains the character ":" then it's treated against the full path. Should work...
- else it's treated against the file name.
hmm.. yeah, that sounds right. I just think I would switch the two first :
- if the pattern contains the character ":" then it's treated against the full path
- elseif the pattern contains no wildcards: it's treated against the extension (ensuring backward compatibility)
- else (no ":" but wildchars) it's treated against the file name.

Just to allow to use a full path/name without wildchars.

The only question is, should relative syntax be supported here as well. Because it might make sense to use it, and then "?:" syntax would work (since there's a ":") and we could use "*:" to specify any drive (not the one from where XY is running)

But the problem is with the other syntax, relative paths (eg: "..\Folder" or "Scripts\*.xys")

So maybe it shouldn't be based on ":" but on ""

That would give us:
- if the pattern contains the character "" then it's treated against the full path (relative syntax supported)
- elseif the pattern contains no wildcards: it's treated against the extension (ensuring backward compatibility)
- else (no "" but wildchars) it's treated against the file name.
Proud XYplorer Fanatic

admin
Site Admin
Posts: 66300
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripts on PFA

Post by admin »

jacky wrote:
admin wrote:What about:
- if the pattern contains no wildcards: it's treated against the extension (ensuring backward compatibility)
- elseif the pattern contains the character ":" then it's treated against the full path. Should work...
- else it's treated against the file name.
hmm.. yeah, that sounds right. I just think I would switch the two first :
- if the pattern contains the character ":" then it's treated against the full path
- elseif the pattern contains no wildcards: it's treated against the extension (ensuring backward compatibility)
- else (no ":" but wildchars) it's treated against the file name.

Just to allow to use a full path/name without wildchars.

The only question is, should relative syntax be supported here as well. Because it might make sense to use it, and then "?:" syntax would work (since there's a ":") and we could use "*:" to specify any drive (not the one from where XY is running)

But the problem is with the other syntax, relative paths (eg: "..\Folder" or "Scripts\*.xys")

So maybe it shouldn't be based on ":" but on ""

That would give us:
- if the pattern contains the character "" then it's treated against the full path (relative syntax supported)
- elseif the pattern contains no wildcards: it's treated against the extension (ensuring backward compatibility)
- else (no "" but wildchars) it's treated against the file name.
Couldn't make more sense. Great! :D

Pagat
Posts: 307
Joined: 09 Oct 2007 21:23
Location: Austria

Re: Scripts on PFA

Post by Pagat »

Code: Select all

+++ Portable File Associations (PFA): Before, you could only state 
      lists of extensions to match the opened file against. Now you can 
      state whole file names or even full, relative, or portable paths; 
      patterns containing wildcards are allowed.
Since jacky already mentioned color filters:
I do have situations where i only want to highlight some files in specific directories. Any chance that this system will be implemented for color filters too?
OS: Windows 11, 64-bit, Version 25H2, Build 26200.8655 (10.0), AMD64
Monitor: 1/2 (Primary) Primary Screen DPI: 96 (100%)

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Scripts on PFA

Post by jacky »

Pagat wrote:Since jacky already mentioned color filters:
I do have situations where i only want to highlight some files in specific directories. Any chance that this system will be implemented for color filters too?
Yeah, that would be realy cool. For color filters and since they're not extension-based, I believe all should be added is: if "" then treated against full path (w/relative syntax), otherwise against filename only.
Could be useful for color filters-only situation, as well as to relate how PFA will behave as well...
Proud XYplorer Fanatic

admin
Site Admin
Posts: 66300
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripts on PFA

Post by admin »

Pagat wrote:

Code: Select all

+++ Portable File Associations (PFA): Before, you could only state 
      lists of extensions to match the opened file against. Now you can 
      state whole file names or even full, relative, or portable paths; 
      patterns containing wildcards are allowed.
Since jacky already mentioned color filters:
I do have situations where i only want to highlight some files in specific directories. Any chance that this system will be implemented for color filters too?
Yo, why not. Done. 8)

Pagat
Posts: 307
Joined: 09 Oct 2007 21:23
Location: Austria

Post by Pagat »

Great! Thanks.
OS: Windows 11, 64-bit, Version 25H2, Build 26200.8655 (10.0), AMD64
Monitor: 1/2 (Primary) Primary Screen DPI: 96 (100%)

Post Reply