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?
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").
-
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