I work with a lot of text files that have names without extension or that are generated automatically so have numeric extensions such as .0001.
In other file explorers I could just set a preference so that any file type (not associated to an application or without extension) would open automatically in my selected text editor, in my case Sublime Text.
Is there a way to set this in XYP? Otherwise I am forced to continually go through the windows pop-up menu "how do you want to open this file?".
Thanks in advance
Open files without extension and unassociated files with same editor
Re: Open files without extension and unassociated files with same editor
Sure, e.g.: an entry (it should be the last one) in PFA (portable file associations):
and create a script with that name in your XY script folder and use something like this:
*>::load "Open via editor.xys";and create a script with that name in your XY script folder and use something like this:
Code: Select all
$ext = gpc(<curitem>, "ext");
if ($ext == "" || regexmatches($ext, "\d{3,4}")) {
run """D:\Tools\EmEditor_x64\EmEditor.exe"" ""<curitem>""";
} else {
open <curitem>, "w";
}
One of my scripts helped you out? Please donate via Paypal
Re: Open files without extension and unassociated files with same editor
Thank you highend.
The script works when I test it stand-alone, but it doesn't seem to work automatically, I still get the prompt to choose the application.
In my PFA list is the only one selected.
Any idea why?
Thanks in advance.
The script works when I test it stand-alone, but it doesn't seem to work automatically, I still get the prompt to choose the application.
In my PFA list is the only one selected.
Any idea why?
Thanks in advance.
Re: Open files without extension and unassociated files with same editor
Show a screenshot of the PFA list entries.
Configuration | Other | Features | Portable File Associations / Portable Openwith Menu
is checked?
Configuration | Other | Features | Portable File Associations / Portable Openwith Menu
is checked?
One of my scripts helped you out? Please donate via Paypal
Re: Open files without extension and unassociated files with same editor
Ok it's working now!
I just hadn't noticed that the PFA list entries had an OK button, so the entry was never saved!
However, do you know why it's not working on all files? I am connected to some network drives and I still get that pesky prompt on certain files without extension. I can't seem to find a pattern.
I just hadn't noticed that the PFA list entries had an OK button, so the entry was never saved!
However, do you know why it's not working on all files? I am connected to some network drives and I still get that pesky prompt on certain files without extension. I can't seem to find a pattern.
Re: Open files without extension and unassociated files with same editor
Then post the full path to such a file?
One of my scripts helped you out? Please donate via Paypal
Re: Open files without extension and unassociated files with same editor
it's working with most files, I wanted to thank you for your help. Hopefully it will be useful to others.
XYplorer Beta Club