I want to set a hotkey (F4) which when pressed with a file selected should open the selected file with pre-defined applications based on the file extensions.
i.e.,
On press of F4,
*.png to open w/ Photoshop
*.mxml to open w/ EditPlus
The default handlers for these type of files are different from what I want them to open with upon pressing of the hotkey.
Can anyone kindly show me how to do this?
How to set a key to open files with predefined applications?
-
srikat
- Posts: 11
- Joined: 15 Apr 2007 05:30
- Contact:
-
Pagat
- Posts: 307
- Joined: 09 Oct 2007 21:23
- Location: Austria
Re: How to set a key to open files with predefined applications?
So you want a png file to be opened with, let's say, Paint if you press "Enter", but with Photoshop if you press "F4"?
Or do you just want to overrule the windows standard handler for png within XY (that's easy with "Portable File Associations").
Or do you just want to overrule the windows standard handler for png within XY (that's easy with "Portable File Associations").
OS: Windows 11, 64-bit, Version 25H2, Build 26200.8655 (10.0), AMD64
Monitor: 1/2 (Primary) Primary Screen DPI: 96 (100%)
Monitor: 1/2 (Primary) Primary Screen DPI: 96 (100%)
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: How to set a key to open files with predefined applications?
One option would be to goto menu "User | Manage Comands | Run script" and put the below script inside field "Script" and set your F4 to it. And you are good to go.srikat wrote:I want to set a hotkey (F4) which when pressed with a file selected should open the selected file with pre-defined applications based on the file extensions.
i.e.,
On press of F4,
*.png to open w/ Photoshop
*.mxml to open w/ EditPlus
The default handlers for these type of files are different from what I want them to open with upon pressing of the hotkey.
Can anyone kindly show me how to do this?
Code: Select all
//Set the extension of the current item to variable $ext
$ext = <curext>;
//Match extension with png, if yes open with photoshop, if no go to next
IF ($ext == png) {
openwith "c:\Program Files\photoshop\photoshop.exe";
}
// Match extension with mxml, if yes open with editplus, if not go to next
ELSEIF ($ext == mxml) {
openwith "c:\Program Files\editplus\editplus.exe";
}
//If not png or mxml do nothing and show status message
ELSE {
status "Not a .png or .mxml file", , alert;
}
XYplorer Beta Club